Class PDFPage
- java.lang.Object
- 
- com.inductiveautomation.rm.pdf.reader.PDFPage
 
- 
 public class PDFPage extends java.lang.ObjectThis class is used by RMPDFFile to read a PDF file (page) for parsing.
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectfindResource(java.lang.String resourceName, java.lang.String name)Returns the named object from the page's resources.java.awt.color.ColorSpacegetColorspace(java.lang.Object csobj)A colorspace can be specified in several ways.java.awt.geom.Rectangle2DgetCropBox()Returns the crop box of this page.java.util.MapgetExtendedGStateNamed(java.lang.String name)Accessors for the resource dictionariesjava.util.MapgetFontDictForAlias(java.lang.String alias)Returns the pdf Font dictionary for a given name (like "/f1").java.awt.image.BufferedImagegetImage()Set everything to the default implementations and return an Image for this page.java.awt.geom.Rectangle2DgetMediaBox()Returns the media box of this page.java.lang.ObjectgetPageContents()Returns the page contents for this page.PDFStreamgetPageContentsStream()Returns the page contents as a PDF stream.java.lang.ObjectgetPageDict(java.util.Map pages, int pnum, int[] start)Returns the page dict for this page.java.lang.ObjectgetPageResources()Returns the main resource directory for the page, which may be a reference.PDFPatterngetPattern(java.lang.String pdfName)Creates a new pattern object for the resource namejava.util.ListgetResources()Returns the resources stack for this page.ShadingPatterngetShading(java.lang.String pdfName)Creates a new shadingPattern for the resource name.java.lang.ObjectgetXObject(java.lang.String pdfName)voidpaint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D r)Draw the page to g, scaled to fit the rectangle r.voidparse()Main entry point for parsing the page marking operationsvoidpopResources()voidpushResources(java.util.Map r)Most pages will have only a single resource dictionary, which it may have inherited from the parent file.
 
- 
- 
- 
Constructor Detail- 
PDFPagepublic PDFPage(PDFFile aPdfFile, int anIndex) Creates a new PDF page for the given PDF file and page index.
 
- 
 - 
Method Detail- 
getMediaBoxpublic java.awt.geom.Rectangle2D getMediaBox() Returns the media box of this page.
 - 
getCropBoxpublic java.awt.geom.Rectangle2D getCropBox() Returns the crop box of this page.
 - 
getResourcespublic java.util.List getResources() Returns the resources stack for this page.
 - 
pushResourcespublic void pushResources(java.util.Map r) Most pages will have only a single resource dictionary, which it may have inherited from the parent file. However, if the page has Forms or Patterns in it, there may be additional, temporary resource dictionaries.
 - 
popResourcespublic void popResources() 
 - 
getPageResourcespublic java.lang.Object getPageResources() Returns the main resource directory for the page, which may be a reference.
 - 
findResourcepublic java.lang.Object findResource(java.lang.String resourceName, java.lang.String name)Returns the named object from the page's resources. Used in more specific methods below for Fonts, ExtGStates, ColorSpaces, etc. This method is specific to entries in the resource dictionary that are themseleves dictionaries, but the only Resource which currently isn't a dictionaries is the ProcSet. If you need the ProcSet or something other than a dictionary, use getResources() and pull it out from there.
 - 
getExtendedGStateNamedpublic java.util.Map getExtendedGStateNamed(java.lang.String name) Accessors for the resource dictionaries
 - 
getFontDictForAliaspublic java.util.Map getFontDictForAlias(java.lang.String alias) Returns the pdf Font dictionary for a given name (like "/f1"). You can use the FontFactory to get interesting objects from the dictionary.
 - 
getColorspacepublic java.awt.color.ColorSpace getColorspace(java.lang.Object csobj) A colorspace can be specified in several ways. If a colorspace needs no arguments, in can just be the name. Otherwise, it is an entry in the page's resource dictionary. The format of the object in the resource dictionary is dependent upon the type of the colorspace. Once we figure out what kind of colorspace it is and the parameters, we can call the ColorFactory to make an awt ColorSpace object.Note that colorspaces in pdf are usually specified as either strings (for one of the built-ins) or arrays (eg. [/CalRGB << ... >>]) 
 - 
getXObject@Nullable public java.lang.Object getXObject(java.lang.String pdfName) 
 - 
getPatternpublic PDFPattern getPattern(java.lang.String pdfName) Creates a new pattern object for the resource name
 - 
getShadingpublic ShadingPattern getShading(java.lang.String pdfName) Creates a new shadingPattern for the resource name. Used by the shading operator
 - 
getPageContentspublic java.lang.Object getPageContents() Returns the page contents for this page.
 - 
getPageContentsStreampublic PDFStream getPageContentsStream() Returns the page contents as a PDF stream.
 - 
getImagepublic java.awt.image.BufferedImage getImage() Set everything to the default implementations and return an Image for this page.
 - 
paintpublic void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D r)Draw the page to g, scaled to fit the rectangle r.
 - 
parsepublic void parse() Main entry point for parsing the page marking operations
 - 
getPageDict@Nullable public java.lang.Object getPageDict(@Nonnull java.util.Map pages, int pnum, int[] start)Returns the page dict for this page.
 
- 
 
-