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

Live Web Application

Example: Lending-out form

Below an example of using XMLMill to generate online .pdf documents with requested information. The generated document will be opened in a new window (samples values are filled in for your convenience).

  • No validation is done on the input.
Name:
Department:
I hereby request my reservation for the following equipment:
Mobile phone
Laptop
LCD Projector
Overhead Projector
Camera
From (date and hour of pick-up)
Until (date and hour of return)
Reason for lend-out

Solution 1: XMLMill's Connector for Cocoon

This lending-out form was made with Cocoon and XMLMill's Connector for Cocoon.


Select to enlarge

  1. The form's fields are POSTED to the website's sitemap, which evaluates the url.
  2. An xsp will take the field values and wrap these into an xml structure.
  3. Next the xsl stylesheet will transform the xml structure into a ml: structure (this is an xml document compliant with the xmlmill.xsd).
  4. This intermediate ml: compliant xml document is then passed to the ml2pdf serializer.
  5. The serializer generates the pdf document and send it to the browser.

Solution 2: Using a org.w3c.dom.Document object

In case you do not use Cocoon, the lending-out form could call a servlet that wraps the form's values into a org.w3c.dom.Document object ans pass this to a PDXTransform instance:


Select to enlarge

  1. The form's fields are POSTED to a servlet.
  2. A org.w3c.dom.Document object is instantiated and the field values and added as elements.
  3. A com.xmlmill.PDXTransform instance is created.
  4. The Document instance is passed to the PDXTransform instance.
  5. The XSL Document is passed to the PDXTransform instance.
  6. The PDXTransform instance generates the pdf document.

Finally the generated document is send to the browser (via the javax.servlet.ServletOutputStream instance).

For more information regarding XMLMill and servlets please consult the XMLMill in Servlet chapter in the User Guide.

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