public class PDFPage
extends java.lang.Object
Constructor and Description |
---|
PDFPage(PDFFile aPdfFile,
int anIndex)
Creates a new PDF page for the given PDF file and page index.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
findResource(java.lang.String resourceName,
java.lang.String name)
Returns the named object from the page's resources.
|
java.awt.color.ColorSpace |
getColorspace(java.lang.Object csobj)
A colorspace can be specified in several ways.
|
java.awt.geom.Rectangle2D |
getCropBox()
Returns the crop box of this page.
|
java.util.Map |
getExtendedGStateNamed(java.lang.String name)
Accessors for the resource dictionaries
|
java.util.Map |
getFontDictForAlias(java.lang.String alias)
Returns the pdf Font dictionary for a given name (like "/f1").
|
java.awt.image.BufferedImage |
getImage()
Set everything to the default implementations and return an Image for this page.
|
java.awt.geom.Rectangle2D |
getMediaBox()
Returns the media box of this page.
|
java.lang.Object |
getPageContents()
Returns the page contents for this page.
|
PDFStream |
getPageContentsStream()
Returns the page contents as a PDF stream.
|
java.lang.Object |
getPageDict(java.util.Map pages,
int pnum,
int[] start)
Returns the page dict for this page.
|
java.lang.Object |
getPageResources()
Returns the main resource directory for the page, which may be a reference.
|
PDFPattern |
getPattern(java.lang.String pdfName)
Creates a new pattern object for the resource name
|
java.util.List |
getResources()
Returns the resources stack for this page.
|
ShadingPattern |
getShading(java.lang.String pdfName)
Creates a new shadingPattern for the resource name.
|
java.lang.Object |
getXObject(java.lang.String pdfName) |
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D r)
Draw the page to g, scaled to fit the rectangle r.
|
void |
parse()
Main entry point for parsing the page marking operations
|
void |
popResources() |
void |
pushResources(java.util.Map r)
Most pages will have only a single resource dictionary, which
it may have inherited from the parent file.
|
public PDFPage(PDFFile aPdfFile, int anIndex)
public java.awt.geom.Rectangle2D getMediaBox()
public java.awt.geom.Rectangle2D getCropBox()
public java.util.List getResources()
public void pushResources(java.util.Map r)
public void popResources()
public java.lang.Object getPageResources()
public java.lang.Object findResource(java.lang.String resourceName, java.lang.String name)
public java.util.Map getExtendedGStateNamed(java.lang.String name)
public java.util.Map getFontDictForAlias(java.lang.String alias)
public java.awt.color.ColorSpace getColorspace(java.lang.Object csobj)
@Nullable public java.lang.Object getXObject(java.lang.String pdfName)
public PDFPattern getPattern(java.lang.String pdfName)
public ShadingPattern getShading(java.lang.String pdfName)
public java.lang.Object getPageContents()
public PDFStream getPageContentsStream()
public java.awt.image.BufferedImage getImage()
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D r)
public void parse()
@Nullable public java.lang.Object getPageDict(@Nonnull java.util.Map pages, int pnum, int[] start)