WKHTMLTOPDF - Perl interface to the wkhtmltopdf program for producing PDF-File from HTML-File.
use WKHTMLTOPDF; my $pdf = new WKHTMLTOPDF; $pdf->_input_file('test.html'); $pdf->_output_file('test.pdf'); $pdf->grayscale(1); $pdf->generate;
Please, visit http://code.google.com/p/wkhtmltopdf/
Path of input file.
Path of output file.
Sets the binary executable name for the command you want to run. Defaul is /usr/bin/wkhtmltopdf.
Collate when printing multiple copies.
Number of copies to print into the pdf file. Default is 1.
Set orientation to Landscape or Portrait.
Set paper size to: A4, Letter, etc.
Use a proxy.
HTTP Authentication username.
HTTP Authentication password.
Set an additional HTTP header (repeatable).
Set the options one would usually set when printing a book.
Use html document as cover. It will be inserted before the toc with no headers and footers.
Add a default header, with the name of the page to the left, and the page number to the right, this is short for: --header-left='[webpage]' --header-right='[page]/[toPage]' --top 2cm --header-line.
Insert a table of content in the beginning of the document.
Change the dpi explicitly (this has no effect on X11 based systems).
Do not allow web pages to run javascript.
PDF will be generated in grayscale.
Generates lower quality pdf/ps. Useful to shrink the result document space.
Set the page bottom margin (default 10mm).
Set the page left margin (default 10mm).
Set the page right margin (default 10mm).
Set the page top margin (default 10mm).
Wait some milliseconds for js-redirects (default 200).
Enable installed plugins (such as flash).
Use this zoom factor (default 1).
Do no make local links.
Do no make links to remote web pages.
Use print media-type instead of screen.
Set the starting page number (default 1).
Disable the intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant.
Use the X server (some plugins and other stuff might not work without X11).
Set the default text encoding, for input.
Do not print background.
Specify a user style sheet, to load with every page.
Centered footer text.
Set footer font name (default Arial)
Set footer font size (default 11)
Left aligned footer text.
Display line above the footer
Right aligned footer text.
Spacing between footer and content in mm (default 0).
Adds a html footer.
Centered header text.
Set header font name (default Arial)
Set header font size (default 11)
Left aligned header text.
Display line above the header.
Right aligned header text.
Spacing between header and content in mm (default 0).
Adds a html header header.
Set the font used for the toc (default Arial)
Do not use dots, in the toc
Set the depth of the toc (default 3).
The header text of the toc (default Table Of Contents).
The font size of the toc header (default 15).
Do not link from toc to sections
Do not link from section header to toc.
Set the font size on level 1 of the toc (default 12)
Set indentation on level 1 of the toc (default 0)
Set the font size on level 2 of the toc (default 10)
Set indentation on level 2 of the toc (default 20)
Set the font size on level 3 of the toc (default 8)
Set indentation on level 3 of the toc (default 40)
Set the font size on level 6 of the toc (default 6)
Set indentation on level 4 of the toc (default 6)
Set the font size on level 5 of the toc (default 4)
Set indentation on level 5 of the toc (default 80)
Set the font size on level 6 of the toc (default 2)
Set indentation on level 6 of the toc (default 100)
Set the font size on level 7 of the toc (default 0)
Set indentation on level 7 of the toc (default 120)
Put an outline into the pdf.
Set the depth of the outline (default 4).
Generate the PDF-File form a HTML-File.
Thiago Rondon <thiago@aware.com.br>
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install WKHTMLTOPDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WKHTMLTOPDF
CPAN shell
perl -MCPAN -e shell install WKHTMLTOPDF
For more information on module installation, please visit the detailed CPAN module installation guide.