fop-pdf-images 2.3

org.apache.fop.render.pdf.pdfbox
Class PDFBoxAdapter

java.lang.Object
  extended by org.apache.fop.render.pdf.pdfbox.PDFBoxAdapter

public class PDFBoxAdapter
extends java.lang.Object

This class provides an adapter for transferring content from a PDFBox PDDocument to FOP's PDFDocument. It is used to parse PDF using PDFBox and write content using FOP's PDF library.


Field Summary
protected static org.apache.commons.logging.Log log
          logging instance
 
Constructor Summary
PDFBoxAdapter(org.apache.fop.pdf.PDFPage targetPage, java.util.Map<java.lang.Object,java.lang.Object> objectCachePerFile, java.util.Map<java.lang.Integer,org.apache.fop.pdf.PDFArray> pageNumbers)
          Creates a new PDFBoxAdapter.
PDFBoxAdapter(org.apache.fop.pdf.PDFPage targetPage, java.util.Map<java.lang.Object,java.lang.Object> objectCachePerFile, java.util.Map<java.lang.Integer,org.apache.fop.pdf.PDFArray> pageNumbers, java.util.Map<java.lang.Object,java.lang.Object> objectCache)
           
 
Method Summary
protected  java.lang.Object cacheClonedObject(java.lang.Object base, java.lang.Object cloned)
           
protected  java.lang.Object cloneForNewDocument(java.lang.Object base)
           
protected  java.lang.Object cloneForNewDocument(java.lang.Object base, java.lang.Object keyBase)
           
protected  java.lang.Object cloneForNewDocument(java.lang.Object base, java.lang.Object keyBase, java.util.Collection exclude)
           
 java.lang.String createStreamFromPDFBoxPage(org.apache.pdfbox.pdmodel.PDDocument sourceDoc, org.apache.pdfbox.pdmodel.PDPage page, java.lang.String key, java.awt.geom.AffineTransform atdoc, org.apache.fop.fonts.FontInfo fontinfo, java.awt.Rectangle pos)
          Creates a stream (from FOP's PDF library) from a PDF page parsed with PDFBox.
protected  java.lang.Object getCachedClone(java.lang.Object base)
           
 int getCurrentMCID()
           
 org.apache.fop.pdf.PDFPage getTargetPage()
           
 void setCurrentMCID(int currentMCID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
logging instance

Constructor Detail

PDFBoxAdapter

public PDFBoxAdapter(org.apache.fop.pdf.PDFPage targetPage,
                     java.util.Map<java.lang.Object,java.lang.Object> objectCachePerFile,
                     java.util.Map<java.lang.Integer,org.apache.fop.pdf.PDFArray> pageNumbers)
Creates a new PDFBoxAdapter.

Parameters:
targetPage - The target FOP PDF page object
objectCachePerFile - the object cache for reusing objects shared by multiple pages.
pageNumbers - references to page object numbers

PDFBoxAdapter

public PDFBoxAdapter(org.apache.fop.pdf.PDFPage targetPage,
                     java.util.Map<java.lang.Object,java.lang.Object> objectCachePerFile,
                     java.util.Map<java.lang.Integer,org.apache.fop.pdf.PDFArray> pageNumbers,
                     java.util.Map<java.lang.Object,java.lang.Object> objectCache)
Method Detail

getTargetPage

public org.apache.fop.pdf.PDFPage getTargetPage()

getCurrentMCID

public int getCurrentMCID()

setCurrentMCID

public void setCurrentMCID(int currentMCID)

cloneForNewDocument

protected java.lang.Object cloneForNewDocument(java.lang.Object base)
                                        throws java.io.IOException
Throws:
java.io.IOException

cloneForNewDocument

protected java.lang.Object cloneForNewDocument(java.lang.Object base,
                                               java.lang.Object keyBase)
                                        throws java.io.IOException
Throws:
java.io.IOException

cloneForNewDocument

protected java.lang.Object cloneForNewDocument(java.lang.Object base,
                                               java.lang.Object keyBase,
                                               java.util.Collection exclude)
                                        throws java.io.IOException
Throws:
java.io.IOException

getCachedClone

protected java.lang.Object getCachedClone(java.lang.Object base)
                                   throws java.io.IOException
Throws:
java.io.IOException

cacheClonedObject

protected java.lang.Object cacheClonedObject(java.lang.Object base,
                                             java.lang.Object cloned)
                                      throws java.io.IOException
Throws:
java.io.IOException

createStreamFromPDFBoxPage

public java.lang.String createStreamFromPDFBoxPage(org.apache.pdfbox.pdmodel.PDDocument sourceDoc,
                                                   org.apache.pdfbox.pdmodel.PDPage page,
                                                   java.lang.String key,
                                                   java.awt.geom.AffineTransform atdoc,
                                                   org.apache.fop.fonts.FontInfo fontinfo,
                                                   java.awt.Rectangle pos)
                                            throws java.io.IOException
Creates a stream (from FOP's PDF library) from a PDF page parsed with PDFBox.

Parameters:
sourceDoc - the source PDF the given page to be copied belongs to
page - the page to transform into a stream
key - value to use as key for the stream
atdoc - adjustment for stream
fontinfo - fonts
pos - rectangle
Returns:
the stream
Throws:
java.io.IOException - if an I/O error occurs

fop-pdf-images 2.3

Copyright 2007-2018 The Apache Software Foundation. All Rights Reserved.