Skip to main content
Skip table of contents

html2pdf

Transforms a given HTML document to PDF.

Attributes

var

 

 

Required

Value type

EL-evaluated

Yes

String

No

Defines the name of the variable holding the produced PDF.

document

 

 

Required

Value type

EL-evaluated

Yes

File

Yes

HTML document to be transformed to PDF.

Template content

Please note these special requirements when creating template to be used with this command.

Table of Contents

Page numbers doesn't work within ToC.

Header and footer

Header and footer are defined as separate HTML fragments. Header root element should have id="header" and footer root element should have id="footer".

Page numbering can be added to footer with following classes:

  • pageNumber current page number

  • totalPages total pages in the document

Page breaks

To cause forced page break before or after use following CSS: break-before: page and break-after: page.

Page size and margins

The @page CSS rule can be used to specify page size and margins.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.