Class PDFFile
- java.lang.Object
- 
- com.inductiveautomation.rm.pdf.reader.PDFFile
 
- 
 public class PDFFile extends java.lang.ObjectThis class is used to read a PDF file for parsing.
- 
- 
Constructor SummaryConstructors Constructor Description PDFFile(byte[] bytes)Creates a new PDF file for the PDF file bytes.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearPageCache()Clears the page cache.ColorFactorygetColorFactory()FontFactorygetFontFactory()Graphics object creation factoriesImageFactorygetImageFactory()PDFMarkupHandlergetMarkupHandler()The callback handlerPDFPagegetPage(int aPageIndex)Returns an individual PDF page for the given page index.intgetPageCount()Returns the number of PDF pages in the PDF file.PathFactorygetPathFactory()floatgetVersion()Gets the pdf version as a float.java.lang.ObjectgetXRefObject(PDFXEntry anEntry)Returns the object from the xref table, reading it if necessary.intgetXRefTablePosition()PDF reading starts at file end - this routine starts at end and searches backwards until it finds startxref key It returns file offset to the xref table (also checks that a valid EOF is present).java.lang.ObjectinheritedAttributeForKeyInPage(java.lang.String aKey, java.util.Map aPage)Returns x.java.lang.ObjectreadCompressedEntry(int ostmNum, int objIndex)voidresetXRefTable()Call this to clear the state of all xref table entries.java.lang.ObjectresolveObject(java.lang.Object obj)Given an object, check to see if its an indirect reference - if so, resolve the reference.voidsetColorFactory(ColorFactory c)voidsetFontFactory(FontFactory f)voidsetImageFactory(ImageFactory f)voidsetMarkupHandler(PDFMarkupHandler h)voidsetPathFactory(PathFactory p)voidsetStripsExtendedGStates(boolean flag)
 
- 
- 
- 
Method Detail- 
getVersionpublic float getVersion() Gets the pdf version as a float.
 - 
getPagepublic PDFPage getPage(int aPageIndex) Returns an individual PDF page for the given page index. This function used to create a new instance every time, but it gets called repeatedly by imagereader and pageparser, so half a dozen (at least) page instances were getting created for every pdf import. This of course also defeated any useful caching behavior in the RMPDFPage.The file could be hundreds of pages big, and we're most likely only ever looking at one page. Creating a sparse array hundreds of elements large seems silly, so we'll use a map instead. 
 - 
clearPageCachepublic void clearPageCache() Clears the page cache.
 - 
getPageCountpublic int getPageCount() Returns the number of PDF pages in the PDF file.
 - 
inheritedAttributeForKeyInPagepublic java.lang.Object inheritedAttributeForKeyInPage(java.lang.String aKey, java.util.Map aPage)Returns x.
 - 
getXRefTablePositionpublic int getXRefTablePosition() PDF reading starts at file end - this routine starts at end and searches backwards until it finds startxref key It returns file offset to the xref table (also checks that a valid EOF is present).
 - 
getXRefObjectpublic java.lang.Object getXRefObject(PDFXEntry anEntry) Returns the object from the xref table, reading it if necessary.
 - 
resolveObjectpublic java.lang.Object resolveObject(java.lang.Object obj) Given an object, check to see if its an indirect reference - if so, resolve the reference.
 - 
readCompressedEntrypublic java.lang.Object readCompressedEntry(int ostmNum, int objIndex)
 - 
resetXRefTablepublic void resetXRefTable() Call this to clear the state of all xref table entries. This will allow objects created while examining the file to get garbage collected.
 - 
setStripsExtendedGStatespublic void setStripsExtendedGStates(boolean flag) 
 - 
getFontFactorypublic FontFactory getFontFactory() Graphics object creation factories
 - 
setFontFactorypublic void setFontFactory(FontFactory f) 
 - 
getPathFactorypublic PathFactory getPathFactory() 
 - 
setPathFactorypublic void setPathFactory(PathFactory p) 
 - 
getColorFactorypublic ColorFactory getColorFactory() 
 - 
setColorFactorypublic void setColorFactory(ColorFactory c) 
 - 
getImageFactorypublic ImageFactory getImageFactory() 
 - 
setImageFactorypublic void setImageFactory(ImageFactory f) 
 - 
getMarkupHandlerpublic PDFMarkupHandler getMarkupHandler() The callback handler
 - 
setMarkupHandlerpublic void setMarkupHandler(PDFMarkupHandler h) 
 
- 
 
-