Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Intelligence Publisher
11g Release 1 (11.1.1)

E22256-01


oracle.xdo.template.pdf.book
Class PDFBookBinder

java.lang.Object
  extended by oracle.xdo.template.pdf.book.PDFBookBinder


public class PDFBookBinder
extends java.lang.Object

Description

The PDFBookBinder class is useful for the merging of PDF files into one document consisting of a hierarchy of chapters, sections, and subsections and also a table of contents for these chapters and sections. Also generated automatically are PDF style "bookmarks", activated by clicking on the "Bookmarks" tab in Adobe Acrobat. The outline structure is determined by the chapter and section hierarchy.

The table of contents formatting and style is created thru the use of a RTF template created in MS Word. The chapters are passed into the program as separate PDF files (one chapter, section, or subsection corresponds to one PDF file). Templates may also be specified at the chapter level for insertion of dynamic or static content, page numbering and placement of hyperlinks within the document. The templates may be in RTF or PDF format. RTF templates are more flexible in that it allows you to insert dynamic content the same way you normally would with XML Publisher. PDF templates are more static, and it is difficult to reflow text areas when inserting page numbers and other types of dynamic content. The templates maybe rotated (at right angles) or be made transparent. A PDF template may also be specified at the book level, enabling the ability to specify global page numbering, as well as other content (like backgrounds and watermarks), at the global document level. A title page can also be passed in a parameter, as well as a cover and / or closing page for each chapter or section.

The structure of the book's chapters, sections, and subsections is represented as XML and passed in as a command line parameter, or it may also be passed in at the API level. In fact, all the chapter and section files, as well as all the templates files and their respective parameters are specified inside this XML structure. Therefore, the only two required parameters passed in is a XML file and a PDF output file. Please see the sample 'toc.xml' file in this same directory for more information about the structure of this XML file.

You may also specify volume breaks inside the book structure. Specifying volume breaks will split the content up into separate output files for easier file and printer management.

To specify template and content file locations in your XML structure, you may specify a path relative to your local file-system or you may also specify a URL referring to the template or content location. Secure HTTP protocol is supported, as well as specially recognized XML Publisher protocols, such as "xdo://" (used to specify XML Publisher Template Manager specific data), "fnd://" (used to specify data located in FND_LOBS table), or "blob://" (used for specifying data in any user defined BLOB table). The format for the "blob://" protocol is:

blob://[table_name].[blob_column_name]/[pk_datatype]:[pk_name]=[pk_value]/../../..

Please see "toc-volumes-blob.xml" for an example of how to use this protocol.

Command line options

Usage: java oracle.xdo.template.pdf.book.PDFBookBinder [-debug <true or false>] [-tmp <temp dir>] -xml <input xml> -pdf <output pdf>

-xml <file>: Filename of input xml file containing table of contents XML structure
-pdf <file>: Final generated PDF output file
-tmp <directory>: Specify temp directory for better memory management (optional, otherwise system environment variable "java.io.tmpdir" will be used)
-outputDir <directory>: Sets output directory (optional, current directory is used by default)
-log <file>: Sets output log file (optional, default is System.out)
-debug <true or false>: Turns on or off debugging

API method call

String xmlInputPath = "c:\\tmp\\toc.xml";

String pdfOutputPath = "c:\\tmp\\final_book.pdf";

PDFBookBinder bookBinder = new PDFBookBinder(xmlInputPath, pdfOutputPath);

bookBinder.setConfig(new Properties());

bookBinder.process();


Field Summary
static java.lang.String RCS_ID
           

 

Constructor Summary
PDFBookBinder()
           
PDFBookBinder(java.io.InputStream xmlInput, java.lang.String pdfOutput)
           
PDFBookBinder(java.lang.String xmlInput, java.lang.String pdfOutput)
           

 

Method Summary
static void main(java.lang.String[] args)
           
 void process()
           
 void setConfig(java.util.Properties prop)
           
 void setMergeBookmarks(boolean flag)
           
 void setOutputDir(java.lang.String anOutputDir)
           
 void setPDFOutput(java.lang.String pdfOutput)
           
 void setXMLInput(java.io.InputStream xmlInput)
           
 void setXMLInput(java.lang.String xmlInput)
           

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

Constructor Detail

PDFBookBinder

public PDFBookBinder()

PDFBookBinder

public PDFBookBinder(java.lang.String xmlInput,
                     java.lang.String pdfOutput)

PDFBookBinder

public PDFBookBinder(java.io.InputStream xmlInput,
                     java.lang.String pdfOutput)

Method Detail

setXMLInput

public void setXMLInput(java.lang.String xmlInput)

setPDFOutput

public void setPDFOutput(java.lang.String pdfOutput)

setXMLInput

public void setXMLInput(java.io.InputStream xmlInput)

setOutputDir

public void setOutputDir(java.lang.String anOutputDir)

setMergeBookmarks

public void setMergeBookmarks(boolean flag)

setConfig

public void setConfig(java.util.Properties prop)

process

public void process()
             throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Business Intelligence Publisher
11g Release 1 (11.1.1)

E22256-01


Copyright © 2010, 2011, Oracle. All rights reserved.