XMLMill - convert xml to pdf with java. Generate PDF from xml/xsl.

High volume xml-xsl to PDF Generation

This page as PDFPrinter friendly pageEmail this page to a friendSubscribe to our mailing list

Examples

Below you find some examples of PDF documents generated with XMLMill. Most examples are included in the download.

Example: Fill the Acrofields of an existing PDF document

pdf/examples/Example_employee-record-form.pdf

As of version 3.00 XMLMill supports filling the Acrofields of an existing PDF document. This examples fills the acrofields of an Employee Record. The code to fill the Acrofields is quite easy:

[001] <ml:acroform>
[002]   <ml:acrofield name="EmployeeID"><xsl:value-of 
        select="employee/id"/></ml:acrofield/>
[004]   <ml:acrofield name="LastName"><xsl:value-of 
        select="employee/name"//></ml:acrofield/>
[006]   ...
[007] </ml:acroform>

The barcode printed on the left is not an Acrofield but directly stamped on it using the ml:barcode element:

[001] <ml:barcode type="code39e" topleft="center,center" 
[002] add-check-digit="on" 
[003] add-check-digit-to-text="on" 
[004] reference-orientation="90" 
[005] font-size="8pt">
[006]   <xsl:attribute name="value"><xsl:value-of 
        select="employee/id"/></xsl:attribute>
[008] </ml:barcode>

This example has not put read-only on for the Acrofields, so the user can still change them.

The next example is the same document but based on a template PDF document with all fields marked as read-only.

The download contains this example (including xml and xsl file).

Example: Fill the Acrofields of an existing PDF document (read-only)

pdf/examples/Example_employee-record-form-RO.pdf

As of version 3.00 XMLMill supports filling the Acrofields of an existing PDF document. This examples fills the acrofields of an Employee Record. The code to fill the Acrofields is quite easy:

[001] <ml:acroform>
[002]   <ml:acrofield readonly="on" name="EmployeeID"><xsl:value-of 
        select="employee/id"/></ml:acrofield/>
[004]   <ml:acrofield readonly="on" name="LastName"><xsl:value-of 
        select="employee/name"//></ml:acrofield/>
[006]   ...
[007] </ml:acroform>

This example has put read-only on for the Acrofields, so the user can no longer change them.

The download contains this example (including xml and xsl file).

Example: Stamp an existing PDF document

pdf/examples/Airwaybill-258-85695.pdf

As of version 3.00 XMLMill supports stamping the pages of an existing PDF document. This way additional information (like text, images, barcodes) can be added to pages of an existing PDF document. This examples 'stamps' a DHL airwaybill. An empty airwaybill document is read and then the data is stamped on it. Check the userguide for more information

The download contains this example (including xml and xsl file).

Example: Multiple-columns on a page

pdf/examples/example_flow-segment.pdf

As of version 2.70 XMLMill supports multiple columns on a page. Moreover, a page can be divided in different segments containing each a different number of columns.

[001] <ml:layout-master-set>
[002]   <ml:simple-page-master ...>
[003]     <ml:region-body  column-count="2" column-gap="5%" />
[004]       ...
[005]   </ml:simple-page-master>
[006] </ml:layout-master-set>
[001] <ml:flow flow-name="xsl-region-body">
[002]   <ml:flow-segment column-count="2" 
[003]                    overflow="error-if-overflow" 
[004]                    height="50%" 
[005]                    segment-name="seg1" >
[006] 				   ...
[007]   
        <ml:flow-segment/>

The download contains this example (including xml and xsl file).

Example: Generating PDF document with Ant

images/examples/xmlmilltask.jpg

As of version 2.70 XMLMill can be integrated in the Ant build tool, giving you the possibility to generate and compare PDF documents.

Each Generate and Compare process is generated in its own JVM instance, minimizing the potential impact on the overall build process (in case something goes wrong..

For more information please visit the XMLMill and Ant chapter in the in the online User Guide.

The download contains this example (including xml and xsl file).

Example: Digital signatures (Thawte / Verisign / SelfSign)

pdf/examples/DigitalSignature.pdf

As of version 2.60 you can sign your documents when generated (one pass generation). This pdf document is signed with the Thawte Free Email Key (see signature at the bottom of the page).

Currently RSA is supported with the SelfSign, Verisign and Thawte certificates.

See for yourself. Open this document in Acrobat 6.0 or higher and verify the signature using the certificate below. For more information on how to do the please read the Digital Signatures document online.

The certificate to verify the document:cert-thawte.cer.

Download the certificate in .zip format so it can be imported in Acrobat Reader: cert-thawte.zip.

The download contains this example (including xml and xsl file).

Example: TrueType Fonts

pdf/examples/Example_font-Mingliu-PMingliu.pdf

As of version 2.50 you can add your own TrueType fonts to a pdf document. TrueType fonts can be embedded or even subsetted in your document. This example shows how the Mingliu and PMingliu (Chinese) fonts can be embedded in the pdf document.

The download contains this example (including xml and xsl file).

Example: TrueType Fonts

pdf/examples/Example_font-Aescrawl.pdf

As of version 2.50 you can add your own TrueType fonts to a pdf document. TrueType fonts can be embedded or even subsetted in your document. This example shows how to use the Aescrawl font, a TrueType font.

The download contains this example (including xml and xsl file).

Example: Phonelist

pdf/examples/phonelist-2.00.pdf

As of version 2.00 XMLMill is based on a new version of the XMLMill kernel, with many new features and performance improvements. The most important new features are:

  • Define multiple page-templates in a document, allowing to have different headers and footers in one document.
  • Page templates can be combined so different page-templates can be applied on different pages (for example odd-pages-, even-pages).
  • Add markers in headers or footers to produce running headers and footers.
  • Page headers and footers can contain different elements like table(s), textbox(es), paragraphs, images, horizontal lines, ...
  • Rotate textboxes, barcodes 90, 180 or 270 degrees.
  • The Code128 barcode has been added as barcode specification.
  • Performance increase between 10% and 30% (size and elapsed time).

The download contains this example (including xml and xsl file).

Example: On-line lending-out form

pdf/examples/example_lending-out.pdf

Use XMLMill to generate online .pdf documents from with-in your webapplications.

With this lending-out form a user can:

  • enter the requested information.
  • generate online the pdf report.

This is just one simple example of how could you use XMLMill to dynamically generate .pdf documents from with-in your web applications.

The download contains this example (including xml and xsl file).

Example: PNG image type

pdf/examples/example_image_png.pdf

As of version 1.52 XMLMill accepts following PNG formats:

  • Indexed-color images of up to 256 colors.
  • Truecolor images of up to 48 bits per pixel.
  • Grayscale images of up to 16 bits per pixel.
  • Full alpha channel (general transparency masks).
  • Interlaced (progressive) PNG images (Adam7 interlaced).
  • PNG's with gamma correction.
  • PNG's with different compression filters.

XMLMill PNG support was tested with Willem van Schaik's Test Suite of PNG Icons (see example).

The download contains this example (including xml and xsl file).

Example: GIF image type

pdf/examples/example_image_gif.pdf

As of version 1.51 XMLMill accepts the GIF87a and GIF89a specification in following formats:

  • Up to 256 colors using 1 to 8 bits.
  • Transparent GIF images.
  • Interlaced images.
  • Animated images.

The download contains this example (including xml and xsl file).

Example: External Type1 fonts

pdf/examples/example_caligula.pdf

As of version 1.50 you can add your own Type1 fonts to a pdf document. Type1 fonts can be embedded or even subsetted in your document. This example shows how to use the Caligula font, a Type1 font.

[001] <ml:p font-type="type1" font-name="Caligula">
[002]   This is the Caligula font.<
[003] /ml:p>

The download contains this example (including xml and xsl file).

Example: Barcode

pdf/examples/employee-record.pdf

As of version 1.50 you can add barcodes in your .pdf document, without the need to have a barcode-font, for example:

[001] <ml:barcode add-check-digit="on" add-check-digit-to-text="on"
[002]             type="code39" value="1234567890" rotation="0"
[003] />

The download contains this example (including xml and xsl file).

Example: Quote

pdf/examples/quote.pdf

This version is a real-life example of a quote document, with multiple images in header and footer.

The download contains this example (including xml and xsl file).

Example: Encryption

pdf/examples/encryption.pdf

As of version 1.40 you can encrypt your documents (40bits or 128bits) when generated, using the <encryption> tag, like:

[001] <encryption 
[002]   user-password="123456" 
[003]   owner-password ="xmlmill" 
[004]   encryption-strength="128"
[005] />

The download contains this example (including xml and xsl file).

Example: Complex Tables

pdf/examples/change_request.pdf

As of version 1.40 you can easily generate complex tables, with row-spanning, column-spanning or each row having a different number of columns and widths.

The download contains this example (including xml and xsl file).

Example: Release Notes

pdf/examples/rnotes135.pdf

As of version 1.35 you can easily generate complete booklets, inclusive automatic table-of-content generation and outlines.

The download contains this example (including xml and xsl file).

Example: Press Article

pdf/examples/article.pdf

This article was made with a .mill file (no XSL used). The .mill file contains formatting instructions and xml data.

The download contains this example (including xml and xsl file).

Example: Foreign Press Article

pdf/examples/article_foreign.pdf

This is a foreign (French) article made with a .mill file (no XSL used). As you can see, XMLMill has no difficulty in generating documents with non ASCII characters (like é, â, ù, ...).

The download contains this example (including xml and xsl file).

Example: Phonelist

pdf/examples/phonelist.pdf

This document was made with a xml file containing the data and a xsl file containing the transforming and formatting instructions.

XMLMill will internally transform the xml data to a .mill stream and then generate the PDF document.

The download contains this example (including xml and xsl file).

Example: Invoice

pdf/examples/invoice.pdf

This document was made with a xml file containing the data and a xsl file containing the transforming and formatting instructions.

XMLMill will internally transform the xml data to a xmlmill xml file and then generate the PDF document.

The download contains this example (including xml and xsl file).

Example: Invoice (2)

pdf/examples/2001-1965.pdf

pdf/examples/2001-1966.pdf

pdf/examples/2001-1967.pdf

pdf/examples/2001-1968.pdf

This document was made with a xml file containing the data and a xsl file containing the transforming and formatting instructions.

Out of 1 xml file 4 PDF files are generated. The names of the PDF file are dynamically generated (based on the invoice number, a xml element).

The download contains this example (including xml and xsl file).

Copyright © 2001 - 2012. All rights reserved. XMLMill and XMLMill logo are trademarks of Pecunia Data Systems, bvba.
Powered by Apache CocoonPowered by XMLMill