NAME

WKHTMLTOPDF - Perl interface to the wkhtmltopdf program for producing PDF-File from HTML-File.

SYNOPSIS

use WKHTMLTOPDF;

my $pdf = new WKHTMLTOPDF;
$pdf->_input_file('test.html');
$pdf->_output_file('test.pdf');
$pdf->grayscale(1);

$pdf->generate;

DESCRIPTION

Please, visit http://code.google.com/p/wkhtmltopdf/

ATTRIBUTES

_input_file

Path of input file.

_out_file

Path of output file.

bin_name

Sets the binary executable name for the command you want to run. Defaul is /usr/bin/wkhtmltopdf.

General Options

collate

Collate when printing multiple copies.

copies

Number of copies to print into the pdf file. Default is 1.

orientation

Set orientation to Landscape or Portrait.

page_size

Set paper size to: A4, Letter, etc.

proxy

Use a proxy.

username

HTTP Authentication username.

password

HTTP Authentication password.

custom_header

Set an additional HTTP header (repeatable).

book

Set the options one would usually set when printing a book.

cover

Use html document as cover. It will be inserted before the toc with no headers and footers.

default_header

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.

toc

Insert a table of content in the beginning of the document.

dpi

Change the dpi explicitly (this has no effect on X11 based systems).

disable_javascript

Do not allow web pages to run javascript.

grayscale

PDF will be generated in grayscale.

lowquality

Generates lower quality pdf/ps. Useful to shrink the result document space.

margin_bottom

Set the page bottom margin (default 10mm).

margin_left

Set the page left margin (default 10mm).

margin_right

Set the page right margin (default 10mm).

margin_top

Set the page top margin (default 10mm).

redirect_delay

Wait some milliseconds for js-redirects (default 200).

enable_plugins

Enable installed plugins (such as flash).

zoom

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.

page_offset

Set the starting page number (default 1).

disable_smart_shrinking

Disable the intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant.

use_xserver

Use the X server (some plugins and other stuff might not work without X11).

enconding

Set the default text encoding, for input.

no_background

Do not print background.

user_style_sheet

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.

header_center

Centered header text.

header_font_name

Set header font name (default Arial)

header_font_size

Set header font size (default 11)

header_left

Left aligned header text.

header_line

Display line above the header.

header_right

Right aligned header text.

header_spacing

Spacing between header and content in mm (default 0).

header_html

Adds a html header header.

Table of content options

toc_font_name

Set the font used for the toc (default Arial)

toc_no_dots

Do not use dots, in the toc

toc_depth

Set the depth of the toc (default 3).

toc_header_text

The header text of the toc (default Table Of Contents).

toc_header_fs

The font size of the toc header (default 15).

Do not link from toc to sections

Do not link from section header to toc.

toc_l1_font_size

Set the font size on level 1 of the toc (default 12)

toc_l1_indentation

Set indentation on level 1 of the toc (default 0)

toc_l2_font_size

Set the font size on level 2 of the toc (default 10)

toc_l2_indentation

Set indentation on level 2 of the toc (default 20)

toc_l3_font_size

Set the font size on level 3 of the toc (default 8)

toc_l3_indentation

Set indentation on level 3 of the toc (default 40)

toc_l4_font_size

Set the font size on level 6 of the toc (default 6)

toc_l4_indentation

Set indentation on level 4 of the toc (default 6)

toc_l5_font_size

Set the font size on level 5 of the toc (default 4)

toc_l5_indentation

Set indentation on level 5 of the toc (default 80)

toc_l6_font_size

Set the font size on level 6 of the toc (default 2)

toc_l6_indentation

Set indentation on level 6 of the toc (default 100)

toc_l7_font_size

Set the font size on level 7 of the toc (default 0)

toc_l7_indentation

Set indentation on level 7 of the toc (default 120)

Outline options

outline

Put an outline into the pdf.

outline_depth

Set the depth of the outline (default 4).

METHODS

generate

Generate the PDF-File form a HTML-File.

AUTHOR

Thiago Rondon <thiago@aware.com.br>

LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.