Class PDFPage
- java.lang.Object
- 
- com.inductiveautomation.rm.pdf.writer.PDFBuffer
- 
- com.inductiveautomation.rm.pdf.writer.PDFPage
 
 
- 
 public class PDFPage extends PDFBuffer All drawing happens in PDFPage object. Contents is a stream to which all the marking functions get appended.
- 
- 
Field SummaryFields Modifier and Type Field Description static byteOPACITY_FILL_ONLYstatic byteOPACITY_SHAPEstatic byteOPACITY_STROKE_AND_FILLstatic byteOPACITY_STROKE_ONLY
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(PDFAnnotation annot)Adds an annotation to the page.java.lang.StringaddColorspace(java.lang.Object cspace)Adds a new colorspace to the resource dict and returns the name by which it's referred.voidaddExtGState(java.lang.String aName, java.util.Map aMap)Adds a named graphics state parameter dict to the ExtGState dict for this page.java.lang.StringaddPattern(java.lang.Object aPattern)Adds a new pattern to the resource dict and returns the name by which it's referred.voidcloseContents(RMPDFWriter aWriter)Caches compressed contents into _stream and releases contents for efficiency.PDFAnnotationgetAnnotation(int anIndex)Returns the specific page annotation at the given index.intgetAnnotationCount()Returns the number of annotations.java.util.MapgetExtGStateMap()Returns the ExtGState dict for this page.java.util.MapgetResourceMap(java.lang.String aResourceName)Returns the named resource dict for this page.voidgrestore()Restores the last graphics state of the writer.voidgsave()Saves the current graphics state of the writer.voidresolvePageReferences(PDFPagesTree pages)Resolves page references for page annotations.voidsetCropBox(RMRect aRect)Sets the crop box for the page.voidsetFillColor(RMColor aColor)Sets the given color to be the current fill color.voidsetLineCap(int aLineCap)Sets the line cap: 0=butt, 1=round, 2=square.voidsetLineJoin(int aLineJoin)Sets the line join: 0=miter, 1=round, 2=bevel.voidsetMediaBox(RMRect aRect)Sets the media box for the page.voidsetOpacity(float anOpacity, byte coverage)Sets the opacity to be the following value, for stroke operations, fill operations or both.voidsetStrokeColor(RMColor aColor)Sets the given color to be the current stroke color.voidsetStrokeWidth(float aWidth)Sets the given line width to be the current line width.voidwritePDF(RMPDFWriter aWriter)Writes the page contents to the pdf buffer.
 
- 
- 
- 
Field Detail- 
OPACITY_STROKE_ONLYpublic static final byte OPACITY_STROKE_ONLY - See Also:
- Constant Field Values
 
 - 
OPACITY_STROKE_AND_FILLpublic static final byte OPACITY_STROKE_AND_FILL - See Also:
- Constant Field Values
 
 - 
OPACITY_FILL_ONLYpublic static final byte OPACITY_FILL_ONLY - See Also:
- Constant Field Values
 
 - 
OPACITY_SHAPEpublic static final byte OPACITY_SHAPE - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
PDFPagepublic PDFPage(PDFFile pFile) Creates a PDF page for the page tree and pfile.
 
- 
 - 
Method Detail- 
setMediaBoxpublic void setMediaBox(RMRect aRect) Sets the media box for the page.
 - 
setCropBoxpublic void setCropBox(RMRect aRect) Sets the crop box for the page.
 - 
setFillColorpublic void setFillColor(RMColor aColor) Sets the given color to be the current fill color.
 - 
setStrokeColorpublic void setStrokeColor(RMColor aColor) Sets the given color to be the current stroke color.
 - 
setStrokeWidthpublic void setStrokeWidth(float aWidth) Sets the given line width to be the current line width.
 - 
setLineCappublic void setLineCap(int aLineCap) Sets the line cap: 0=butt, 1=round, 2=square.
 - 
setLineJoinpublic void setLineJoin(int aLineJoin) Sets the line join: 0=miter, 1=round, 2=bevel.
 - 
setOpacitypublic void setOpacity(float anOpacity, byte coverage)Sets the opacity to be the following value, for stroke operations, fill operations or both. Stupidly, there's no setOpacity or setRGBAColor op in PDF, so you have to modify the gstate parameter dict directly using the generic graphics state operator gs, which takes a name of a gstate map in page's ExtGState map (we have to add this silly little gstate map manually for each unique opacity).
 - 
gsavepublic void gsave() Saves the current graphics state of the writer.
 - 
grestorepublic void grestore() Restores the last graphics state of the writer.
 - 
getAnnotationCountpublic int getAnnotationCount() Returns the number of annotations.
 - 
getAnnotationpublic PDFAnnotation getAnnotation(int anIndex) Returns the specific page annotation at the given index.
 - 
addAnnotationpublic void addAnnotation(PDFAnnotation annot) Adds an annotation to the page.
 - 
getResourceMappublic java.util.Map getResourceMap(java.lang.String aResourceName) Returns the named resource dict for this page.
 - 
getExtGStateMappublic java.util.Map getExtGStateMap() Returns the ExtGState dict for this page.
 - 
addExtGStatepublic void addExtGState(java.lang.String aName, java.util.Map aMap)Adds a named graphics state parameter dict to the ExtGState dict for this page.
 - 
addColorspacepublic java.lang.String addColorspace(java.lang.Object cspace) Adds a new colorspace to the resource dict and returns the name by which it's referred.
 - 
addPatternpublic java.lang.String addPattern(java.lang.Object aPattern) Adds a new pattern to the resource dict and returns the name by which it's referred.
 - 
resolvePageReferencespublic void resolvePageReferences(PDFPagesTree pages) Resolves page references for page annotations.
 - 
closeContentspublic void closeContents(RMPDFWriter aWriter) Caches compressed contents into _stream and releases contents for efficiency.
 - 
writePDFpublic void writePDF(RMPDFWriter aWriter) Writes the page contents to the pdf buffer.
 
- 
 
-