Package com.reportmill.pdf
Class PDFPageBuffer
java.lang.Object
com.reportmill.base.RMObject
com.reportmill.pdf.PDFBuffer
com.reportmill.pdf.PDFPageBuffer
- All Implemented Interfaces:
- RMArchiver.Archiving,- Cloneable
This class is a subclass of PDFBuffer, that knows how to write an RMPage and its shapes. It maintains graphics state
 to avoid unnecessary marking operators.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final byte
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetPage()Returns the pdf page for this page bufer.voidgrestore()Restores the last graphics state of the writer.voidgsave()Saves the current graphics state of the writer.voidsetFillColor(RMColor aColor) Sets the given color to be the current fill color.voidsetLineCap(int cap) Sets the line cap: 0=butt, 1=round, 2=square.voidsetLineJoin(int join) Sets the line join: 0=miter, 1=round, 2=bevelvoidsetOpacity(float anOpacity, byte coverage) Sets the opacity to be the following value, for stroke operations, fill operations or both.voidsetShading(RMGradientFill gradient, RMShape aShape, RMPath aPath) Sets the current shading pattern to the gradient specified by the given RMGradientFillvoidsetStrokeColor(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.voidWrites PDF for a plain RMFill.voidwriteGradientFill(RMGradientFill gradient, RMShape aShape, RMPath aPath) Writes pdf for the path filled with a shading pattern defined by the RMGradientFillvoidwriteShapeFill(RMShape aShape, RMFill aFill, RMPath aPath, PDFFile pFile) Writes PDF for an individual shape fill.voidwriteStroke(RMStroke aStroke, RMPath aPath) Writes PDF for a plain RMStroke.Methods inherited from class com.reportmill.pdf.PDFBufferappend, append, append, curveTo, length, lineTo, moveTo, print, print, print, print, print, print, print, println, println, println, println, printPDFString, quadTo, toByteArray, transform, transformMethods inherited from class com.reportmill.base.RMObjectclone, copy, didChange, didUndo, getAnimAttribute, getClassNameShort, initWithArchiver, undoClone, undoCopy, undoEquals
- 
Field Details- 
OPACITY_STROKE_ONLYpublic static final byte OPACITY_STROKE_ONLY- See Also:
 
- 
OPACITY_STROKE_AND_FILLpublic static final byte OPACITY_STROKE_AND_FILL- See Also:
 
- 
OPACITY_FILL_ONLYpublic static final byte OPACITY_FILL_ONLY- See Also:
 
 
- 
- 
Constructor Details- 
PDFPageBufferCreates a new PDFWriter.
 
- 
- 
Method Details- 
getPageReturns the pdf page for this page bufer.
- 
writeShapeFillWrites PDF for an individual shape fill.
- 
writeStrokeWrites PDF for a plain RMStroke.
- 
writeFillWrites PDF for a plain RMFill.
- 
setFillColorSets the given color to be the current fill color.
- 
writeGradientFillWrites pdf for the path filled with a shading pattern defined by the RMGradientFill
- 
setShadingSets the current shading pattern to the gradient specified by the given RMGradientFill
- 
setStrokeColorSets the given color to be the current stroke color.
- 
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).
- 
setStrokeWidthpublic void setStrokeWidth(float aWidth) Sets the given line width to be the current line width.
- 
setLineCappublic void setLineCap(int cap) Sets the line cap: 0=butt, 1=round, 2=square.
- 
setLineJoinpublic void setLineJoin(int join) Sets the line join: 0=miter, 1=round, 2=bevel
- 
gsavepublic void gsave()Saves the current graphics state of the writer.
- 
grestorepublic void grestore()Restores the last graphics state of the writer.
 
-