Package com.ribs.pdf
Class PDFPage
java.lang.Object
com.ribs.pdf.PDFPage
This class is used by RMPDFFile to read a PDF file (page) for parsing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindResource
(String resourceName, String name) Returns the named object from the page's resources.getColorspace
(Object csobj) A colorspace can be specified in several ways.Returns the crop box of this page.getExtendedGStateNamed
(String name) Accessors for the resource dictionariesgetFontDictForAlias
(String alias) Returns the pdf Font dictionary for a given name (like "/f1").getImage()
Set everything to the default implementations and return an Image for this page.Returns the media box of this page.Returns the page contents for this page.Returns the page contents as a PDF stream.getPageDict
(Hashtable pages, int pnum, int[] start) Returns the page dict for this page.Returns the main resource directory for the page, which may be a reference.getPattern
(String pdfName) Creates a new pattern object for the resource nameReturns the resources stack for this page.getShading
(String pdfName) Creates a new shadingPattern for the resource name.getXObject
(String pdfName) void
parse()
Main entry point for parsing the page marking operationsvoid
void
pushResources
(Map r) Most pages will have only a single resource dictionary, which it may have inherited from the parent file.
-
Constructor Details
-
PDFPage
Creates a new PDF page for the given PDF file and page index.
-
-
Method Details
-
getMediaBox
Returns the media box of this page. -
getCropBox
Returns the crop box of this page. -
getResources
Returns the resources stack for this page. -
pushResources
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. -
popResources
public void popResources() -
getPageResources
Returns the main resource directory for the page, which may be a reference. -
findResource
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. -
getExtendedGStateNamed
Accessors for the resource dictionaries -
getFontDictForAlias
Returns the pdf Font dictionary for a given name (like "/f1"). You can use the FontFactory to get interesting objects from the dictionary. -
getColorspace
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
-
getPattern
Creates a new pattern object for the resource name -
getShading
Creates a new shadingPattern for the resource name. Used by the shading operator -
getPageContents
Returns the page contents for this page. -
getPageContentsStream
Returns the page contents as a PDF stream. -
getImage
Set everything to the default implementations and return an Image for this page. -
parse
public void parse()Main entry point for parsing the page marking operations -
getPageDict
Returns the page dict for this page.
-