The block diagram below illustrates the process of creating a PDF from an XML or XHTML/HTML document using PDFreactor. In general it can be divided into five distinct steps:
The host application feeds the XML, XHTML or HTML input as well as the CSS stylesheets, which specify style and layout of the final PDF document. To achieve more advanced tasks, e.g. to calculate the total from values of an XML-based invoice, the host application could also feed XSLT stylesheets, which will automatically be processed.
The content preprocessing can be divided into four main parts: encoding detection, cleanup, parsing and XSLT processing. HTML or legacy HTML web content is converted to XHTML first. This is automatically done by one of the built-in cleanup processes. For optional XSL transformation, PDFreactor uses the default Java XSLT processor, which can be set by the integrator through the corresponding setting in the Java VM's system properties.
The XMLreactor Core Engine provides three functions. First the style specific processing with the assembling of language specific style information for XHTML or generic XML. Secondly the styled DOM creation where the style computation for each XML element and creation of a styled DOM is performed. The third function is the main layout engine which individually positions and styles each element depending upon the computed style.
The PDF writer transforms the layout information into PDF objects and assembles these into a document. It also resolves bookmarks as well as internal and external links within the document. This step also takes care of embedding true type fonts into the PDF.
The PDF output can be displayed on the Web, returned to a Web client, attached to emails or streamed to printers and other devices.
![]() |