Class PDFFile
java.lang.Object
com.inductiveautomation.rm.pdf.reader.PDFFile
This class is used to read a PDF file for parsing.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidClears the page cache.Graphics object creation factoriesThe callback handlergetPage(int aPageIndex) Returns an individual PDF page for the given page index.intReturns the number of PDF pages in the PDF file.floatGets the pdf version as a float.getXRefObject(PDFXEntry anEntry) Returns the object from the xref table, reading it if necessary.intPDF 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).inheritedAttributeForKeyInPage(String aKey, Map aPage) Returns x.readCompressedEntry(int ostmNum, int objIndex) voidCall this to clear the state of all xref table entries.resolveObject(Object obj) Given an object, check to see if its an indirect reference - if so, resolve the reference.voidvoidvoidvoidvoidvoidsetStripsExtendedGStates(boolean flag) 
- 
Constructor Details- 
PDFFilepublic PDFFile(byte[] bytes) Creates a new PDF file for the PDF file bytes.
 
- 
- 
Method Details- 
getVersionpublic float getVersion()Gets the pdf version as a float.
- 
getPageReturns 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.
- 
inheritedAttributeForKeyInPageReturns 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).
- 
getXRefObjectReturns the object from the xref table, reading it if necessary.
- 
resolveObjectGiven an object, check to see if its an indirect reference - if so, resolve the reference.
- 
readCompressedEntry
- 
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) 
- 
getFontFactoryGraphics object creation factories
- 
setFontFactory
- 
getPathFactory
- 
setPathFactory
- 
getColorFactory
- 
setColorFactory
- 
getImageFactory
- 
setImageFactory
- 
getMarkupHandlerThe callback handler
- 
setMarkupHandler
 
-