Class PDFPage
java.lang.Object
com.inductiveautomation.rm.pdf.writer.PDFOutput
com.inductiveautomation.rm.pdf.writer.PDFBuffer
com.inductiveautomation.rm.pdf.writer.PDFPage
All drawing happens in PDFPage object. Contents is a stream to which all the marking functions get appended.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(PDFAnnotation annot) Adds an annotation to the page.addColorspace
(Object cspace) Adds a new colorspace to the resource dict and returns the name by which it's referred.void
addExtGState
(String aName, Map aMap) Adds a named graphics state parameter dict to the ExtGState dict for this page.addPattern
(Object aPattern) Adds a new pattern to the resource dict and returns the name by which it's referred.void
closeContents
(RMPDFWriter aWriter) Caches compressed contents into _stream and releases contents for efficiency.getAnnotation
(int anIndex) Returns the specific page annotation at the given index.int
Returns the number of annotations.Returns the ExtGState dict for this page.getResourceMap
(String aResourceName) Returns the named resource dict for this page.void
grestore()
Restores the last graphics state of the writer.void
gsave()
Saves the current graphics state of the writer.void
Resolves page references for page annotations.void
setCropBox
(RMRect aRect) Sets the crop box for the page.void
setFillColor
(RMColor aColor) Sets the given color to be the current fill color.void
setLineCap
(int aLineCap) Sets the line cap: 0=butt, 1=round, 2=square.void
setLineJoin
(int aLineJoin) Sets the line join: 0=miter, 1=round, 2=bevel.void
setMediaBox
(RMRect aRect) Sets the media box for the page.void
setOpacity
(float anOpacity, byte coverage) Sets the opacity to be the following value, for stroke operations, fill operations or both.void
setStrokeColor
(RMColor aColor) Sets the given color to be the current stroke color.void
setStrokeWidth
(float aWidth) Sets the given line width to be the current line width.void
writePDF
(RMPDFWriter aWriter) Writes the page contents to the pdf buffer.Methods inherited from class com.inductiveautomation.rm.pdf.writer.PDFBuffer
append, append, append, length, toByteArray
-
Field Details
-
OPACITY_STROKE_ONLY
public static final byte OPACITY_STROKE_ONLY- See Also:
-
OPACITY_STROKE_AND_FILL
public static final byte OPACITY_STROKE_AND_FILL- See Also:
-
OPACITY_FILL_ONLY
public static final byte OPACITY_FILL_ONLY- See Also:
-
OPACITY_SHAPE
public static final byte OPACITY_SHAPE- See Also:
-
-
Constructor Details
-
PDFPage
Creates a PDF page for the page tree and pfile.
-
-
Method Details
-
setMediaBox
Sets the media box for the page. -
setCropBox
Sets the crop box for the page. -
setFillColor
Sets the given color to be the current fill color. -
setStrokeColor
Sets the given color to be the current stroke color. -
setStrokeWidth
public void setStrokeWidth(float aWidth) Sets the given line width to be the current line width. -
setLineCap
public void setLineCap(int aLineCap) Sets the line cap: 0=butt, 1=round, 2=square. -
setLineJoin
public void setLineJoin(int aLineJoin) Sets the line join: 0=miter, 1=round, 2=bevel. -
setOpacity
public 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). -
gsave
public void gsave()Saves the current graphics state of the writer. -
grestore
public void grestore()Restores the last graphics state of the writer. -
getAnnotationCount
public int getAnnotationCount()Returns the number of annotations. -
getAnnotation
Returns the specific page annotation at the given index. -
addAnnotation
Adds an annotation to the page. -
getResourceMap
Returns the named resource dict for this page. -
getExtGStateMap
Returns the ExtGState dict for this page. -
addExtGState
Adds a named graphics state parameter dict to the ExtGState dict for this page. -
addColorspace
Adds a new colorspace to the resource dict and returns the name by which it's referred. -
addPattern
Adds a new pattern to the resource dict and returns the name by which it's referred. -
resolvePageReferences
Resolves page references for page annotations. -
closeContents
Caches compressed contents into _stream and releases contents for efficiency. -
writePDF
Writes the page contents to the pdf buffer.
-