Guest User

Untitled

a guest
Aug 10th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. how to use Options in PDF module in play framework
  2. public class Design extends Controller {
  3. public static void renderPDFGen()
  4. {
  5. Options options = new Options();
  6. options.HEADER_TEMPLATE = "/design/renderPDFHeader";
  7. options.filename = "Invoice";
  8. renderPdf(options);
  9. }
  10.  
  11. public static void renderPDFHeader()
  12. {
  13. render();
  14. }
  15. }
  16.  
  17. public static void renderPDFHeader()
  18. {
  19. //calculate the contents for the pdf
  20. String var1, var2;
  21.  
  22. //create Options helper
  23. PDF.Options options = new PDF.Options();
  24. options.filename="myfile.pdf";
  25. //etc...
  26.  
  27. //render
  28. renderPdf(options, var1, var2); //note it's renderPDF, not render
  29. }
Add Comment
Please, Sign In to add comment