Use FOP to convert XML to a PDF. This article explains how you can use FOP (Formatting Objects Processor) to convert XML data to a PDF document, which can then be printed on a user\'s default printer.
Tutorial Details:
The use of intranets has enabled employees operating in offices spread across the globe to access a centralized application at their company headquarters. The ability to create and print documents over their company\'s intranet would prove to be valuable functionality for such employees.
With such functionality in place, what would happen if a user (say in Japan or India) wants to print hundreds of PDF documents using a default printer from a centralized application that runs on servers in the U.S. Opening each PDF with Acrobat Reader and printing all the documents individually would not only be time consuming, but also tedious. A solution that fires multiple PDFs to the default printer so the user doesn\'t need to open Acrobat Reader would prove most helpful.
Formatting Objects Processor (FOP) is an open source Java API that can convert your XML data directly into reports in PDF format. The software is developed under the Apache XML Graphics Project and is free to use. This article shows you how to convert raw data (from Oracle Database) to XML, which, in turn, is converted to reports in PDF format. It is assumed the user has a basic understanding of technologies like Java, XML, BEA WebLogic Server, Enterprise JavaBeans (EJB), FOP, Extensible Stylesheet Language Transformations (XSLT), and Oracle Database.
The figure below gives an overview of the flow of data. The XML data along with the XSL file forms the input to the FOP processor, which in turn is configured using the userconfig.xml for Unicode fonts.
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Create and print multilingual PDF documents on the client
View Tutorial: Create and print multilingual PDF documents on the client
Related
Tutorials:
Java 2 introduces print
capability to
the Swing Forum - JavaWorld June 1999
Java 2 introduces print
capability to
the Swing Forum - JavaWorld June 1999 |
Printing in
Java, Part 1 - JavaWorld October 2000
Printing in
Java, Part 1 - JavaWorld October 2000 |
Printing in
Java, Part 2 - JavaWorld December 2000
Printing in
Java, Part 2 - JavaWorld December 2000 |
Printing in
Java, Part 3 - JavaWorld January 2001
Printing in
Java, Part 3 - JavaWorld January 2001 |
Printing in
Java, Part 4 - JavaWorld February
2001
Printing in
Java, Part 4 - JavaWorld February
2001 |
Printing in
Java, Part 5 - JavaWorld March
2001
Printing in
Java, Part 5 - JavaWorld March
2001 |
Jato: The new kid on the open source block, Part 3 - JavaWorld May
2001
Jato: The new kid on the open source block, Part 3 - JavaWorld May
2001 |
JavaMail quick start
JavaMail quick start |
XSLT blooms with
Java
XSLT blooms with
Java |
Boost Struts with
Boost Struts with XSLT and XML |
Dictionary and Thesaurus API for Java
What is the Dictionary and Thesaurus API for JavaTM?
The Dictionary and Thesaurus API for Java is a standard-based class library for accessing a dictionary and thesaurus using Java. It provides programming access to wordbook data from the Java programm |
Joott Quick Start Guide
Joott Quick Start Guide
JooTemplates is a templating system to generate business documents, such as forms, mailings and reports. It is being developed with the following aims |
SpeedJG - XML Builder
SpeedJG - XML based Java Swing GUI Builder |
Excerpt from Apache Axis Live
Excerpt from Apache Axis Live
This chapter, "Getting Started with the Apache Axis Project," you will take "a brief look at what Axis is and how it implements some of the SOAP services. |
Creating Varargs in Java 1.5 Tiger
Creating Varargs in Java 1.5 Tiger
In this excerpt from Chapter 5 of the book, Brett and David cover how to create and iterate over variable-length argument lists (better known as varargs), which will have you writing better, cleaner, more flexible code |
PDFTextStream v1.1.2 Released; Fast Java PDF Text Extraction
PDFTextStream is the ideal solution for Java applications and J2EE web services that need to rapidly and accurately extract text and document metadata from PDF files. |
FOP is the world's first print formatter driven by XSL formatting objects.
It is a Java application that reads a formatting object tree and then turns it into a PDF document. The formatting object tree, can be in the form of an XML document (output by an XSLT engine like XT or Xalan) or can be passed in memory as a DOM Document |
Adding search to your applications
The Lucene search engine is an open source, Jakarta project used to build and search indexes. Lucene can index any text-based information you like and then find it later based on various search criteria. |
Just Forms PDF library
The JustFormsPDF library is a Java class library for filling or editing interactive PDF forms on-the-fly. Empower your applications with the industry-standard PDF forms technology using JustFormsPDF. |
Sun Studio 10 Documentation Online
Full documentation for the Sun Studio 10 compilers and tools is now available on the Sun Developer's Portal. |
|
|
|