node-wkhtmltoimage
node-wkhtmltoimage copied to clipboard
Some options have changed from the official documentation such as pageWidth
After some trial and error I realized the best way to see the options available is to install the binary on your system and run the --help command.
I was having trouble setting pageSize, pageWidth and pageHeight and I realized it was resulting in no output to the stream. After installing the binary it seems those options may not be supported. These are the options the wkhtmltoimage binary showed me:
Description:
Converts an HTML page into an image,
General Options:
--crop-h <int> Set height for cropping
--crop-w <int> Set width for cropping
--crop-x <int> Set x coordinate for cropping
--crop-y <int> Set y coordinate for cropping
-H, --extended-help Display more extensive help, detailing
less common command switches
-f, --format <format> Output file format
--height <int> Set screen height (default is calculated
from page content) (default 0)
-h, --help Display help
--license Output license information and exit
--quality <int> Output image quality (between 0 and 100)
(default 94)
-q, --quiet Be less verbose
-V, --version Output version information and exit
--width <int> Set screen width, note that this is used
only as a guide line. Use
--disable-smart-width to make it strict.
(default 1024)