HTML based custom reports
To adjust PDF-reports easily, HTML-based custom reports can be used. The visual appearance is controlled by a HTML-Template and Custom Style Sheets (CSS), while the reported details are directly requested from the software itself or (optionally) parsed from an internally created XML-report.
Structure of related files
A predefined HTML-template is contained in all installer packages for Desktop and Server/CLI.
This predefined template can be found in:
- Server/CLI: ../cli/var/Reports/Templates
- Desktop/PlugIn: User Preferences/callas software/[pdfToolbox or pdfaPilot] version/Reports/Templates (using Desktop/PlugIn, a HTML-based report must have been generated at least once, in order to have these these files created)
The predefined template contains several folders and files
- index.html the template in HTML format
- manifest.xml a XML file which defines information needed as content for the report, to be delievered by the engine
- /css contains a style sheet
- /fonts contains used fonts
- /img contains used images
It is highly recommended to create a copy of the original template in a separate folder when starting to adjust a HTML-template based report.
Note: The HTML converter is using WebKit, so it is recommended to use Safari (or Chrome, which is based on a spin-off of WebKit) as a browser.
Request basic informations about PDF
<x:dict> <x:overview/> <
If contained, document information and results of the performed profile will be available for using them in the HTML template.
Preview images of pages
<x:preview resolution="150" page="1"/>
Rendering of images of one or more pages for visual represenation of the PDF in the report.
Images are exported into the file system as png files. The folder in the intermediate HTML is:
More than one page preview can be exported (starting with pdfToolbox 10/pdfaPilot 8, until then only 1 image could be exported) when the manifest.xml has the following entry:
<x:results> <x:preview resolution="100" firstPage="1" lastPage="30"/> </x:results>
To create previews of all pages, the "lastPage" parameter can be set to "-1".
The links to the pages are also listed in cals_params.js.
Visual comparision of original and processed file
Include compare tree if comparison resources are used inside index.html.
resolution resolution used in ppi for rendering the comparision
Keep the temporarily generated files
false files become deleted (default)
true files will not become deleted
Creating a XML report for additional content
<x:xmlreport path=xml/report.xml inkcovres=72 inkcovbox=TrimBox/> </x:results>
inkcovres resolution in ppi, used for determining the effective ink coverage of each page in the PDF (optional, default: 300)
inkcovbox page geometry box of which the effective ink coverage will be determined (optional, default: CropBox)
The HTML template
The HTML template can easily be modified using an appropriate code-editor or enhanced text-editor.
The provided HTML-template already contains some dummy data, which is automatically replaced by actual content when a new report is gener-ated. So, when doing adjustments to the template with custom profiles and PDF files, it is recommended to keep the temporarily generated files for debugging, as a basis for modifications and their review in a browser.
- Note: It is possible to use image formats (like JPEG or PNG) as well as PDFs for positioning visual content like logos. If you want to debug your HTML in an HTML Browser you may want to display an image instead of the PDF reference. You can do this by putting identically named files for images and PDF next to each other. The PDF file must be referenced in the img tag in the HTML-template. The usage of PDF files allows for higher quality of logos in the resulting PDF report.
How the HTML-template works
The provided HTML-template already contains all document and processing information which can be supplied directly from the application.
Examples for template modification
callas software is providing a number of sample templates, which can be downloaded as tewo ZIP archives from the links below.
Extended functionality starting with pdfToolbox 10/pdfaPilot 8
Please see the article "Extensions for Template-based reports" for new possibilities invented with pdfToolbox 10/pdfaPilot 8.