Bookbindin' 2

Trying to get back on track here ... too many demos to get working for various events. Back to bookbinding - hope fully the introduction I provided gave you an idea of what the bookbinding API is and what it can be used for. Before we get to the nitty gritty its worth knowing ehats going on under the covers.


BookBind2:


We have our disperate PDFs to the left coming from various sources - the BookBinding APIs sits amid the Publisher engine. It takes a control file in the form of XML as a set of instructions on how to build the bound document - the control file will reference layout templates that can be overlaid atop the the final combined document.


The control file is the most important piece - there is no builder for this and it can get complicated but if we start with the basics and work our way up to the more complex you'll understand the structure.


For the examples I have taken a bunch of Oracle product 'brochures' that we can then bind. They reside in the 'oracle_books' directory in the zip file available here. Unpack the zip and check out the first example.


Example1 - Simple Merge plus front page

In this example we will merge the three Oracle overview documents and add a front page to the document. So we will have a document structure as follows:
1. Front Page
2. Database Overview
3. Application Server Overview
4. E Business Suite Overview

The XML control file for this is pretty straightforward:


<?xml version="1.0" encoding="utf-8"?>
<outline xmlns="http://xmlns.oracle.com/oxp/book/">
  <!--
   The 'title-page' element should point to a PDF title page inserted
   at the beginning of the book. (OPTIONAL)
  -->
  <!-- So here is the title page reference, in this case it is going to use an RTF template -->
  <title-page type="rtf">templates/title_page.rtf</title-page>
  <!-- nex follow the three documents we want to combine -->
  <item>
    <content>../oracle_books/database_overview.pdf</content>
  </item>
  <item>
    <content>../oracle_books/appserver_overview.pdf</content>
  </item>
  <item>
    <content>../oracle_books/ebs_brochure.pdf</content>
  </item>
</outline>


I have provided an html page and annotated control file that hopefully provides you with enough information to work out what is going on. The first example takes a template, title_page.rtf from the templates directory and then prefixes it to the following three pdf documents. Cant get much simpler than this.


To run the example you'll find a cmd file that can be run directly in Windows other OS' you need to set environment variables accordingly . Its a straightforward java call to the command line interface of the bookbinder API.


set CLASSPATH=..libxdo.zip;..libxdoparser.jar;..libxmlparserv2.jar;..libi18nAPI_v3.jar;..libaolj.jar
set JAVA_CLASS=oracle.apps.xdo.template.pdf.book.PDFBookBinder
set JAVA_OPTS=-mx150m
set JAVA_CMD=%JAVA_HOME% -classpath %CLASSPATH% %JAVA_OPTS% %JAVA_CLASS%
echo %JAVA_CMD% -debug true -tmp ..tmp -xml Example1.xml -pdf Example1.pdf
%JAVA_CMD% -debug true -tmp ..tmp -xml Example1.xml -pdf Example1.pdf


The command line arguments take the form


-debug true|false -tmp <temporary directory location> -xml <control file location> -pdf <output file location>


Give it a try - you might have to do a little jiggery pokery with the cmd file to get it working. Notice I have JAVA_HOME set to pick up the java executable to run the API.


Enough for today, try out the first few examples and we'll pick up some of the more complex examples next time.

<?xml version="1.0" encoding="utf-8"?><OUTLINE xmlns="http://xmlns.oracle.com/oxp/book/"><!-- So here is the title page reference, in this case it is going to use an RTF template --><TITLE-PAGE type="rtf"></ITEM></OUTLINE>

Comments:

There does not seem to be a link to the zip file here.

Posted by Ron Morton on September 08, 2008 at 11:54 PM MDT #

I would like to take a look at this... but there is no ZIP file as advertised.

Posted by Gary Grubb on November 16, 2009 at 03:44 AM MST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today