I use PhantomJS for PDF generation.
This is my command:
./phantomjs rasterize.js <someurl> test.pdf
It generates pdf file but:
The following change to rasterize.js also doesn't seem to work:
{ format: system.args[3], orientation: 'Letter', margin: '1cm' }
Rasterize.js is a very basic example of screen capture. There are some default values in this example that you can change to your needs.
Simulates the size of the window like in a traditional browser. In rasterize.js, it's { width: 600, height: 600 }
; not a common resolution and you may need to change this.
Defines the size of the web page when rendered as a PDF. There are two modes : Manual (given a width and a height) or automatic (given a format). Do not hesitate to read the webpage documentation and the wiki page.
In your case, orientation: 'Letter'
is invalid.
Supported formats are 'A3', 'A4', 'A5', 'Legal', 'Letter', 'Tabloid'.
Supported orientation are 'portrait' and 'landscape'.
Take a look at the source code and change it to your needs !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With