html2ps/pdf directives

Back to table of contents

Page-breaking commands

You can force a page break by inserting any one of the following commands into the HTML page:

<!--NewPage-->
<pagebreak/>
<?page-break>

It is highly NOT RECOMMENDED to use these directives inside table cells, as you can get unpredictable results.

Special fields

Note that these fields are processed by separate filter (PreTreeFilterHTML2PSFields). If you're using HTML2PS API, you should install this filter using the following code:

pipeline->pre_tree_filters[] = new PreTreeFilterHTML2PSFields();
Name Replaced with
##PAGE## Number of current page
##PAGES## Total number of pages in the generated PDF file. Note that this directive will show number of pages in current source file when the script is run in batch mode.
##FILENAME## Filename (URL) of the source HTML
##FILESIZE## Size of the source file (without included files)
##TIMESTAMP## Date/time the PDF file have been generated