degu.degudocumentbuilder.ejb
Class PDFBookMarks2XML

java.lang.Object
  extended by degu.degudocumentbuilder.ejb.PDFBookMarks2XML

public class PDFBookMarks2XML
extends java.lang.Object

Converts PDF Doc Bookmarks into XML


Field Summary
private static org.apache.log4j.Logger logger
           
private  java.util.HashMap<org.pdfbox.pdmodel.PDPage,java.lang.Integer> pageNrMap
           
private  org.pdfbox.pdmodel.PDDocument pdDocument
           
 
Constructor Summary
PDFBookMarks2XML()
           
 
Method Summary
private  void convertRecursive(org.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem item, org.jdom.Element e)
          Transforms recursively item into XML, output is e
private  void fillInMissingEndPages(org.jdom.Element e)
          convertRecursive() can't extract easily every end page, therefore the missing ones are expesively extracted through jdom
 org.jdom.Element getXMLBookMarks(org.pdfbox.pdmodel.PDDocument pdDocument, org.jdom.Element tocElement)
          converts bookmarks into XML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.apache.log4j.Logger logger

pdDocument

private org.pdfbox.pdmodel.PDDocument pdDocument

pageNrMap

private java.util.HashMap<org.pdfbox.pdmodel.PDPage,java.lang.Integer> pageNrMap
Constructor Detail

PDFBookMarks2XML

public PDFBookMarks2XML()
Method Detail

getXMLBookMarks

public org.jdom.Element getXMLBookMarks(org.pdfbox.pdmodel.PDDocument pdDocument,
                                        org.jdom.Element tocElement)
                                 throws CorruptedPDFException,
                                        java.io.IOException
converts bookmarks into XML

Parameters:
pdDocument -
Returns:
Throws:
java.io.IOException
CorruptedPDFException

convertRecursive

private void convertRecursive(org.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem item,
                              org.jdom.Element e)
                       throws java.io.IOException
Transforms recursively item into XML, output is e

Parameters:
item -
e -
Throws:
java.io.IOException

fillInMissingEndPages

private void fillInMissingEndPages(org.jdom.Element e)
convertRecursive() can't extract easily every end page, therefore the missing ones are expesively extracted through jdom

Parameters:
e -