Style Intelligence v12.0

inetsoft.report
Class PDFPrinter

java.lang.Object
  extended by java.awt.Graphics
      extended by java.awt.Graphics2D
          extended by inetsoft.report.PDFPrinter
All Implemented Interfaces:
inetsoft.report.internal.CustomGraphics, PDFDevice, PrintGraphics, Serializable, Cloneable
Direct Known Subclasses:
PDF3Printer

public class PDFPrinter
extends Graphics2D
implements PDFDevice

PDFPrinter can be used to generate a PDF file from a report. This PDF printer simulates an actual printer, and generates a very accurately printer simulates an actual printer, and generates a very accurately formatted PDF document.

This class provides a simple implementation. For full featured PDF generation, use inetsoft.report.pdf.PDF3Generator.

See Also:
Serialized Form

Nested Class Summary
protected  class PDFPrinter.CountWriter
           
protected  class PDFPrinter.ImageInfoCache
           
protected  class PDFPrinter.PDFWriter
           
protected  class PDFPrinter.RadioButtonGroup
          Radio button group stores info of a radio group.
static class PDFPrinter.StructurePart
           
 
Field Summary
protected  FontMetrics afm
           
protected  Map annots
           
protected  List annotsIds
           
protected static String[] charname
           
protected static int[][] charRanges
           
protected  FontMetrics fm
           
protected  List fnList
           
protected  Map fnObj
           
protected  Map fontFn
           
protected  Map fontmap
          Font mapping table.
protected  Map fontObj
           
protected  int insetx
           
protected  PDFPrinter.CountWriter others
           
protected  String outlines
           
protected  int pageheight
          Page height in points.
protected  List pageIds
           
protected  int pagewidth
          Page width in points.
protected  PDFPrinter.PDFWriter pg
           
protected  String psFontName
           
static int RESOLUTION
          Page resolution.
 
Fields inherited from interface inetsoft.report.internal.CustomGraphics
G_DASH_LINE, JPEG_EXPORT
 
Constructor Summary
PDFPrinter()
          Create an empty PDFPrinter.
PDFPrinter(File outf)
          Construct a PDFPrinter graphics content.
PDFPrinter(OutputStream o)
          Constructs a new PDFPrinter Object.
 
Method Summary
 void addAnnotation(int id, int page)
          Add an annotation to the PDF.
 boolean addField(inetsoft.report.internal.FieldPainterPaintable pt)
          Add a field to the current pdf document.
 Integer addLink(Hyperlink.Ref link, Rectangle linkBounds, double pgH, Map actions, int page, boolean flush)
          Adds an annotation for a link.
 void addObject(int id, String obj)
          Add an object to the PDF.
 void addObject(int id, String obj, boolean flush)
          Add an object to the PDF.
 void addRenderingHints(Map hints)
          Not supported.
 void checkTextObj(boolean txt)
          Make sure currently in the text segment (BT-ET).
 void clearRect(double x, double y, double width, double height)
           
 void clearRect(int x, int y, int width, int height)
          Clears the specified rectangle by filling it with the current background color of the current drawing surface.
 void clip(Shape s)
           
 void clipRect(double x, double y, double width, double height)
           
 void clipRect(int x, int y, int width, int height)
          Clips to a rectangle.
 Object clone()
           
 void close()
          Close the pdf output stream.
protected  boolean containsArabicCombinCharacter()
           
 void copyArea(int x, int y, int width, int height, int dx, int dy)
          Copies an area of the screen.
 Graphics create()
          Creates a new PDFPrinter Object that is a copy of the original PDFPrinter Object.
 Graphics create(int x, int y, int width, int height)
          Creates a new Graphics Object with the specified parameters, based on the original Graphics Object.
protected  void debug(PDFPrinter.PDFWriter os, String m)
           
 void dispose()
          Disposes of this graphics context.
 boolean doImage(Image img, int x, int y, int width, int height, ImageObserver observer, Color bgcolor)
          Draw image.
 boolean doImage(Image img, int x, int y, int width, int height, int sx1, int sy1, int sx2, int sy2, ImageObserver observer, Color bgcolor)
          Draw image.
 void draw(Shape s)
          Draw a shape.
 void draw3DRect(double x, double y, double width, double height, boolean raised)
           
 void draw3DRect(int x, int y, int width, int height, boolean raised)
          Draws a highlighted 3-D rectangle.
 void drawArc(double x, double y, double width, double height, double startAngle, double arcAngle, int arcType)
           
 void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Draws an arc bounded by the specified rectangle from startAngle to endAngle.
 void drawBytes(byte[] data, int offset, int length, int x, int y)
          Draws the specified bytes using the current font and color.
 void drawChars(char[] data, int offset, int length, int x, int y)
          Draws the specified characters using the current font and color.
 void drawGlyphVector(GlyphVector g, float x, float y)
          Draw string.
 void drawImage(BufferedImage img, BufferedImageOp op, int x, int y)
          Draw image.
 boolean drawImage(Image img, AffineTransform xform, ImageObserver obs)
          Draw image.
 boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer)
          Draws the specified image at the specified coordinate (x, y).
 boolean drawImage(Image img, int x, int y, ImageObserver observer)
          Draws the specified image at the specified coordinate (x, y).
 boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer)
          Draws the specified image inside the specified rectangle.
 boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer)
          Draws the specified image inside the specified rectangle.
 boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer)
          Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.
 boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
          Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.
 void drawLine(double x1, double y1, double x2, double y2)
           
 void drawLine(int x1, int y1, int x2, int y2)
          Draws a line between the coordinates (x1,y1) and (x2,y2).
 void drawOval(double x, double y, double width, double height)
           
 void drawOval(int x, int y, int width, int height)
          Draws an oval inside the specified rectangle using the current color.
 void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Draws a polygon defined by an array of x points and y points.
 void drawPolygon(Polygon p)
          Draws a polygon defined by the specified point.
 void drawPolyline(float[] xPoints, float[] yPoints, int nPoints)
          Draws a sequence of connected lines defined by arrays of x and y coordinates.
 void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)
          Draws a sequence of connected lines defined by arrays of x and y coordinates.
 void drawRect(double x, double y, double width, double height)
           
 void drawRect(int x, int y, int width, int height)
          Draws the outline of the specified rectangle using the current color.
 void drawRenderableImage(RenderableImage img, AffineTransform xform)
          Draw image.
 void drawRenderedImage(RenderedImage img, AffineTransform xform)
          Draw image.
 void drawRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
           
 void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Draws an outlined rounded corner rectangle using the current color.
 void drawString(AttributedCharacterIterator iterator, float x, float y)
          Draw string.
 void drawString(AttributedCharacterIterator iterator, int x, int y)
          Draw string.
 char[] drawString(String str, double sx, double sy)
          Draw string with double coordinate values.
 void drawString(String str, float sx, float sy)
           
 void drawString(String str, int sx, int sy)
          Draws the specified String using the current font and color.
 void emit(String cmd)
          Emit a PDF command to the output stream.
protected  void emitClip(double x, double y, double width, double height)
           
protected  void emitcm(AffineTransform tx)
          Output a matrix command.
protected  String emitFont(Font font)
          Send the set font command to output.
protected  int emitImage(inetsoft.report.internal.MetaImage image, int x, int y, Dimension isize, Color bgcolor)
          Create an image object from a jpeg.
protected  int emitImage(inetsoft.util.PixelConsumer pc, int x, int y, Dimension isize, ImageObserver observer, Color bgcolor)
          Create an image object.
protected  void emitTj(String txt)
          Output the Tj command.
 void endArtifact()
          Marks the end of a non-content artifact.
 void endFigure()
          Marks the end of a figure.
 void endHeading()
          Marks the end of a heading.
 void endParagraph()
          Marks the end of a paragraph of text.
 void endTable()
          Marks the end of a table.
 void endTableCell()
          Marks the end of a table data cell.
 void endTableHeader()
          Marks the end of a table header cell.
 void fill(Shape s)
          Fill shape.
 void fill3DRect(double x, double y, double width, double height, boolean raised)
           
 void fill3DRect(int x, int y, int width, int height, boolean raised)
          Paints a highlighted 3-D rectangle using the current color.
 void fillArc(double x, double y, double width, double height, double startAngle, double arcAngle)
           
 void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Fills an arc using the current color.
 void fillOval(double x, double y, double width, double height)
           
 void fillOval(int x, int y, int width, int height)
          Fills an oval inside the specified rectangle using the current color.
 void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)
          Fills a polygon with the current color.
 void fillPolygon(Polygon p)
          Fills the specified polygon with the current color.
 void fillRect(double x, double y, double width, double height)
           
 void fillRect(int x, int y, int width, int height)
          Fills the specified rectangle with the current color.
 void fillRoundRect(double x, double y, double width, double height, double arcWidth, double arcHeight)
           
 void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight)
          Draws a rounded rectangle filled in with the current color.
 Color getBackground()
          Get the background color.
 String getBaseFontName(String fontname, Font font)
          Get Base font name, if font name is wide char string, just use the font name with US locale.
 Shape getClip()
          Gets the current clipping area.
 Rectangle getClipBounds()
          Returns the bounding rectangle of the current clipping area.
 Color getColor()
          Gets the current color.
 Composite getComposite()
           
 GraphicsConfiguration getDeviceConfiguration()
          Not supported.
 DocumentInfo getDocumentInfo()
          Get the document info.
 PDFEncryptInfo getEncryptInfo()
          Get the PDF document encryption infomation.
 Font getFont()
          Gets the current font.
 FontMetrics getFontMetrics()
          Gets the current font metrics.
 FontMetrics getFontMetrics(Font f)
          Gets the current font metrics for the specified font.
 String getFontName(Font font)
          Get the pdf font name corresponding to the Java font name.
 FontRenderContext getFontRenderContext()
           
protected  String getNaturalLanguage()
          Writes the natural language attribute for the catalog dictionary.
protected  int getNextFontIndex()
          Get the next font index.
 int getNextObjectID()
          Get the next objectID.
 int getNextPatternID()
          Get the next objectID.
 int getOutputSize()
          Get the current output size.
 Size getPageSize()
          Get the current page size.
 Paint getPaint()
           
 String getPDFVersion()
          Return the PDF version of the documents generated by this class.
 PrinterJob getPrinterJob()
          Returns the PrinterJob that is controlling the current rendering request.
 PrintJob getPrintJob()
          Get the printjob object associated with this object, which contains the page size and resolution information.
protected  String getPSFontNameWithInsetx(String pfname, int ix)
          Return the PS Font Name with insetx as suffix.
 Object getRenderingHint(RenderingHints.Key hintKey)
          Not supported.
 RenderingHints getRenderingHints()
          Not supported.
 Locale getReportLocale()
          Gets the locale of the report being rendered.
 Stroke getStroke()
           
protected  String getTextString(int onum, int gnum, Object obj)
          Get the text string representation.
protected  String getTextString(Object obj)
          Get the wide string.
protected  String getTextString(Object obj, boolean wide)
          Get the wide string.
 AffineTransform getTransform()
           
 int grestore(int level)
          Restore graphics context up-to the specified level.
 void gsave(int level)
          PDF save.
 boolean hit(Rectangle rect, Shape s, boolean onStroke)
          Not supported.
 boolean isAccessible()
          Gets the flag that determines if an accessible PDF file is generated.
 boolean isAsciiOnly()
          Check if the output is ascii only.
protected  boolean isBase14Font(String fontin)
          Check if a font is base14 font.
 boolean isCompressImage()
          Check if compression is on.
 boolean isCompressText()
          Check if compression is on.
protected  boolean isCurrentCJKFont()
          Check if current using font is CJK font.
 boolean isEncrypted()
          Check if the PDF document should be encrypted.
protected  boolean isInsetxNeeded(String pfname, int ix)
           
 boolean isMapSymbols()
          Check if symbol mapping is enabled.
 boolean isOpenBookmark()
          Get the value of the "openBookmark" flag.
 boolean isOpenThumbnail()
          Get the value of the "openThumbnail" flag.
 boolean isPrintScaling()
          Gets the "PrintScaling" flag.
 boolean isSupported(int feature)
           
protected  boolean isWideCharString(String str, boolean font)
          Check if a string contains unicode.
 void putFontName(String javaName, String psFontName)
          Add the mapping for the pdf font name corresponding to the Java font name.
 void rotate(double theta)
           
 void rotate(double theta, double x, double y)
           
 void scale(double sx, double sy)
           
 void setAccessible(boolean accessible)
          Sets the flag that determines if an accessible PDF file is generated.
 void setAsciiOnly(boolean ascii)
          Set whether the output should only contain 7 bits ascii code only.
 void setBackground(Color c)
          Set the background color.
 void setClip(double x, double y, double width, double height)
           
 void setClip(int x, int y, int width, int height)
          Sets the current clip to the rectangle specified by the given coordinates.
 void setClip(Shape s)
           
 void setColor(Color c)
          Sets the current color to the specified color.
 void setComposite(Composite comp)
          Sets the Composite for the Graphics2D context.
 void setCompressImage(boolean comp)
          Set whether to compress the image object and streams in the PDF.
 void setCompressText(boolean comp)
          Set whether to compress the text object and streams in the PDF.
 void setDocumentInfo(DocumentInfo info)
          Set the document info.
 void setEncryptInfo(PDFEncryptInfo info)
          Set the PDF document encryption infomation.
 void setFont(Font font)
          Sets the font for all subsequent text-drawing operations.
 void setLineWidth(float w)
          Set the line width in points.
 void setMac(boolean isMac)
           
 void setMapSymbols(boolean map)
          Set whether to map unicode characters for greek and math symbols to symbol font characters.
 void setOpenBookmark(boolean openBookmark)
          Set the "openBookmark" flag (which indicates whether bookmarks should be immediately displayed when the PDF file is opened).
 void setOpenThumbnail(boolean openThumbnail)
          Set the "openThumbnail" flag (which indicates whether thumbnails should be immediately displayed when the PDF file is opened).
 void setOrientation(int orient)
          Set page orientation.
 void setOutput(OutputStream o)
          Set the output stream for the PDF output.
 void setPageSize(double width, double height)
          Set the page size in inches.
 void setPageSize(Size size)
          Set the page size in inches.
 void setPaint(Paint paint)
          Set the brush of painting.
 void setPaintMode()
          Sets the default paint mode to overwrite the destination with the current color.
 void setPrinterJob(PrinterJob job)
          Set the printer job associated with this graphics.
 void setPrintScaling(boolean printScaling)
          Sets the "PrintScaling" flag.
 void setRenderingHint(RenderingHints.Key hintKey, Object hintValue)
          Not supported.
 void setRenderingHints(Map hints)
          Not supported.
 void setReportLocale(Locale reportLocale)
          Sets the locale of the report being rendered.
 void setStroke(Stroke s)
          Set the painting pen.
 void setStructurePart(PDFPrinter.StructurePart structurePart)
          Set which page part is being processed.
 void setTransform(AffineTransform tx)
           
 void setXORMode(Color c1)
          Sets the paint mode to alternate between the current color and the new specified color.
 void shear(double shx, double shy)
           
static String[] splitWords(String str)
          Split delimited string into array of words.
 void startArtifact()
          Marks the start of a non-content artifact.
 void startDoc()
          Initialize file.
 void startFigure(String altText)
          Marks the beginning of a figure.
 void startHeading(int level)
          Marks the start of a heading.
protected  void startPage()
          Initialize a new page.
 void startParagraph(Integer linkId)
          Marks the beginning of a paragraph of text.
 void startTable()
          Marks the beginning of a table.
 void startTableCell(Integer linkId)
          Marks the beginning of a table data cell.
 void startTableHeader(Integer linkId)
          Marks the beginning of a table header cell.
 void startTableRow()
          Marks the beginning of a table row.
protected  float stringWidth(String str)
          Return the string width.
 String toString()
          Returns a String object representing this Graphic's value.
 void transform(AffineTransform tx)
           
protected  void transformRect(Rectangle2D.Double rect, boolean reverse)
           
protected  double transformX(double x)
          Translate Java coordinate to PDF coordinate.
protected  double transformY(double y)
          Flip Y coords so PDFPrinter looks like Java.
 void translate(double x, double y)
           
 void translate(int x, int y)
           
protected  void updateCharacterSet(String s)
          Updates the set of characters used for the current font to include the characters of the specified string.
protected  void writeAdditionalResources(PrintWriter os)
          This function is called to allow additional resources to be written to the current page.
protected  void writeAnnotations()
          Write out the annotations.
protected  int writeEncoding(int idx)
          Write the encoding object
 int writeGradientPaint(GradientPaint gpaint)
          Write pattern object.
protected  void writeOthers()
          flush out the others buffer.
 int writePattern(Image img)
          Write pattern object.
protected  void writePatternResources(PrintWriter os)
          Write the pattern resources.
 
Methods inherited from class java.awt.Graphics
finalize, getClipBounds, getClipRect, hitClip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pageheight

protected int pageheight
Page height in points.


pagewidth

protected int pagewidth
Page width in points.


RESOLUTION

public static final int RESOLUTION
Page resolution.

See Also:
Constant Field Values

fontmap

protected Map fontmap
Font mapping table.


fm

protected FontMetrics fm

afm

protected FontMetrics afm

pg

protected PDFPrinter.PDFWriter pg

others

protected PDFPrinter.CountWriter others

psFontName

protected String psFontName

fontFn

protected Map fontFn

fnList

protected List fnList

fontObj

protected Map fontObj

fnObj

protected Map fnObj

pageIds

protected List pageIds

annotsIds

protected List annotsIds

annots

protected Map annots

outlines

protected String outlines

insetx

protected int insetx

charname

protected static String[] charname

charRanges

protected static int[][] charRanges
Constructor Detail

PDFPrinter

public PDFPrinter()
Create an empty PDFPrinter. The setOutput() and startDoc() must be called before the PDFPrinter can be used.


PDFPrinter

public PDFPrinter(File outf)
           throws IOException
Construct a PDFPrinter graphics content. The pdf output is sent to the specified file.

Parameters:
outf - output file.
Throws:
IOException

PDFPrinter

public PDFPrinter(OutputStream o)
Constructs a new PDFPrinter Object. Unlike regular Graphics objects, PDFPrinter contexts can be created directly.

Parameters:
o - Output stream for PostScript output
See Also:
create()
Method Detail

setOutput

public void setOutput(OutputStream o)
Set the output stream for the PDF output.

Specified by:
setOutput in interface PDFDevice

setCompressText

public void setCompressText(boolean comp)
Set whether to compress the text object and streams in the PDF. Currently only Zip compression is supported, as the consequence the output is only compatible with Acrobat 3.0 and later versions. By default this is true.

Specified by:
setCompressText in interface PDFDevice
Parameters:
comp - compression option.

isCompressText

public boolean isCompressText()
Check if compression is on.

Specified by:
isCompressText in interface PDFDevice
Returns:
true if text objects are compressed.

setAsciiOnly

public void setAsciiOnly(boolean ascii)
Set whether the output should only contain 7 bits ascii code only. It defaults to false.

Specified by:
setAsciiOnly in interface PDFDevice
Parameters:
ascii - output ascii only.

isAsciiOnly

public boolean isAsciiOnly()
Check if the output is ascii only.

Specified by:
isAsciiOnly in interface PDFDevice
Returns:
true if ascii only.

setCompressImage

public void setCompressImage(boolean comp)
Set whether to compress the image object and streams in the PDF. Currently only Zip compression is supported, as the consequence the output is only compatible with Acrobat 3.0 and later versions. By default this is true.

Specified by:
setCompressImage in interface PDFDevice
Parameters:
comp - compression option.

isCompressImage

public boolean isCompressImage()
Check if compression is on.

Specified by:
isCompressImage in interface PDFDevice
Returns:
true if image objects are compressed.

setMapSymbols

public void setMapSymbols(boolean map)
Set whether to map unicode characters for greek and math symbols to symbol font characters.

Specified by:
setMapSymbols in interface PDFDevice

isMapSymbols

public boolean isMapSymbols()
Check if symbol mapping is enabled.

Specified by:
isMapSymbols in interface PDFDevice

setOpenBookmark

public void setOpenBookmark(boolean openBookmark)
Set the "openBookmark" flag (which indicates whether bookmarks should be immediately displayed when the PDF file is opened).


isOpenBookmark

public boolean isOpenBookmark()
Get the value of the "openBookmark" flag.


setOpenThumbnail

public void setOpenThumbnail(boolean openThumbnail)
Set the "openThumbnail" flag (which indicates whether thumbnails should be immediately displayed when the PDF file is opened). This option and the "openBookmark" option are mutually exclusive, with "setOpenBookmark()" having priority if both are called.


isOpenThumbnail

public boolean isOpenThumbnail()
Get the value of the "openThumbnail" flag.


setPrintScaling

public void setPrintScaling(boolean printScaling)
Sets the "PrintScaling" flag. This determines if the PDF viewer uses the application defaults for print scaling or none.

Parameters:
printScaling - true to set print scaling to the application default; false for none.

isPrintScaling

public boolean isPrintScaling()
Gets the "PrintScaling" flag. This determines if the PDF viewer uses the application defaults for print scaling or none.

Returns:
true to set print scaling to the application default; false for none.

isAccessible

public boolean isAccessible()
Gets the flag that determines if an accessible PDF file is generated. By default, this option is disabled.

Accessible PDF files will be larger and may take longer to generate.

Returns:
true to generate an accessible PDF; false otherwise.
Since:
11.4

setAccessible

public void setAccessible(boolean accessible)
Sets the flag that determines if an accessible PDF file is generated. By default, this option is disabled.

Accessible PDF files will be larger and may take longer to generate.

Parameters:
accessible - true to generate an accessible PDF; false otherwise.
Since:
11.4

getReportLocale

public Locale getReportLocale()
Gets the locale of the report being rendered.

Returns:
the report locale.
Since:
11.4

setReportLocale

public void setReportLocale(Locale reportLocale)
Sets the locale of the report being rendered.

Parameters:
reportLocale - the report locale.
Since:
11.4

startParagraph

public void startParagraph(Integer linkId)
Marks the beginning of a paragraph of text. This method has no effect if an accessible PDF is not being generated.

Specified by:
startParagraph in interface PDFDevice
Parameters:
linkId - the identifier of the link annotation associated with the paragraph.

endParagraph

public void endParagraph()
Marks the end of a paragraph of text. This method has no effect if an accessible PDF is not being generated.

Specified by:
endParagraph in interface PDFDevice

startHeading

public void startHeading(int level)
Marks the start of a heading. This method has no effect if an accessible PDF is not being generated.

Specified by:
startHeading in interface PDFDevice
Parameters:
level - the heading level.

endHeading

public void endHeading()
Marks the end of a heading. This method has no effect if an accessible PDF is not being generated.

Specified by:
endHeading in interface PDFDevice

startFigure

public void startFigure(String altText)
Marks the beginning of a figure. This method has no effect if an accessible PDF is not being generated.

Specified by:
startFigure in interface PDFDevice
Parameters:
altText - the alternate text for the chart graphic.

endFigure

public void endFigure()
Marks the end of a figure. This method has no effect if an accessible PDF is not being generated.

Specified by:
endFigure in interface PDFDevice

startTable

public void startTable()
Marks the beginning of a table. This method has no effect if an accessible PDF is not being generated.

Specified by:
startTable in interface PDFDevice

endTable

public void endTable()
Marks the end of a table. This method has no effect if an accessible PDF is not being generated.

Specified by:
endTable in interface PDFDevice

startTableRow

public void startTableRow()
Marks the beginning of a table row. This method has no effect if an accessible PDF is not being generated.

Specified by:
startTableRow in interface PDFDevice

startTableHeader

public void startTableHeader(Integer linkId)
Marks the beginning of a table header cell. This method has no effect if an accessible PDF is not being generated.

Specified by:
startTableHeader in interface PDFDevice
Parameters:
linkId - the identifier of the link annotation associated with the paragraph.

endTableHeader

public void endTableHeader()
Marks the end of a table header cell. This method has no effect if an accessible PDF is not being generated.

Specified by:
endTableHeader in interface PDFDevice

startTableCell

public void startTableCell(Integer linkId)
Marks the beginning of a table data cell. This method has no effect if an accessible PDF is not being generated.

Specified by:
startTableCell in interface PDFDevice
Parameters:
linkId - the identifier of the link annotation associated with the paragraph.

endTableCell

public void endTableCell()
Marks the end of a table data cell. This method has no effect if an accessible PDF is not being generated.

Specified by:
endTableCell in interface PDFDevice

startArtifact

public void startArtifact()
Marks the start of a non-content artifact. This method has no effect if an accessible PDF is not being generated.

Specified by:
startArtifact in interface PDFDevice

endArtifact

public void endArtifact()
Marks the end of a non-content artifact. This method has no effect if an accessible PDF is not being generated.

Specified by:
endArtifact in interface PDFDevice

setDocumentInfo

public void setDocumentInfo(DocumentInfo info)
Set the document info.


getDocumentInfo

public DocumentInfo getDocumentInfo()
Get the document info.


setEncryptInfo

public void setEncryptInfo(PDFEncryptInfo info)
Set the PDF document encryption infomation.


getEncryptInfo

public PDFEncryptInfo getEncryptInfo()
Get the PDF document encryption infomation.


isEncrypted

public boolean isEncrypted()
Check if the PDF document should be encrypted.


getPageSize

public Size getPageSize()
Get the current page size.

Specified by:
getPageSize in interface PDFDevice

setPageSize

public void setPageSize(double width,
                        double height)
Set the page size in inches.

Parameters:
width - page width.
height - page height.

setPageSize

public void setPageSize(Size size)
Set the page size in inches. Common paper sizes are defined as constants in StyleConstants.

Specified by:
setPageSize in interface PDFDevice
Parameters:
size - Size object in inches.

setOrientation

public void setOrientation(int orient)
Set page orientation.

Specified by:
setOrientation in interface inetsoft.report.internal.CustomGraphics
Specified by:
setOrientation in interface PDFDevice
Parameters:
orient - orientation, StyleConstants.PORTRAIT or StyleConstants.LANDSCAPE.

getFontName

public String getFontName(Font font)
Get the pdf font name corresponding to the Java font name.

Specified by:
getFontName in interface PDFDevice
Parameters:
font - Java font.
Returns:
pdf font name.

putFontName

public void putFontName(String javaName,
                        String psFontName)
Add the mapping for the pdf font name corresponding to the Java font name.

Specified by:
putFontName in interface PDFDevice
Parameters:
javaName - Java font name.
psFontName - mapped font name.

getTextString

protected String getTextString(Object obj,
                               boolean wide)
Get the wide string.


getTextString

protected String getTextString(Object obj)
Get the wide string.


getTextString

protected String getTextString(int onum,
                               int gnum,
                               Object obj)
Get the text string representation. Use Hex String.


updateCharacterSet

protected void updateCharacterSet(String s)
Updates the set of characters used for the current font to include the characters of the specified string.

Parameters:
s - the string to add.

isWideCharString

protected final boolean isWideCharString(String str,
                                         boolean font)
Check if a string contains unicode.


addField

public boolean addField(inetsoft.report.internal.FieldPainterPaintable pt)
Add a field to the current pdf document.

Specified by:
addField in interface PDFDevice
Returns:
true if field is supported, false if the field is not supported and should be rendered as usual.

getOutputSize

public int getOutputSize()
Get the current output size.

Returns:
size in bytes.

getPrintJob

public PrintJob getPrintJob()
Get the printjob object associated with this object, which contains the page size and resolution information.

Specified by:
getPrintJob in interface PDFDevice
Specified by:
getPrintJob in interface PrintGraphics
Returns:
print job object.

create

public Graphics create()
Creates a new PDFPrinter Object that is a copy of the original PDFPrinter Object. The Graphics object MUST be disposed explicitly after its use. The Graphics object MUST be disposed before the original PDFPrinter graphics object can be used.

Specified by:
create in class Graphics

create

public Graphics create(int x,
                       int y,
                       int width,
                       int height)
Creates a new Graphics Object with the specified parameters, based on the original Graphics Object. This method translates the specified parameters, x and y, to the proper origin coordinates and then clips the Graphics Object to the area.

Overrides:
create in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the area
height - the height of the area
See Also:
translate(int, int)

getColor

public Color getColor()
Gets the current color.

Specified by:
getColor in class Graphics

setBackground

public void setBackground(Color c)
Set the background color.

Specified by:
setBackground in class Graphics2D

getBackground

public Color getBackground()
Get the background color.

Specified by:
getBackground in class Graphics2D

setColor

public void setColor(Color c)
Sets the current color to the specified color. All subsequent graphics operations will use this specified color.

Specified by:
setColor in class Graphics
Parameters:
c - the color to be set

setPaintMode

public void setPaintMode()
Sets the default paint mode to overwrite the destination with the current color. PostScript has only paint mode.

Specified by:
setPaintMode in class Graphics

setXORMode

public void setXORMode(Color c1)
Sets the paint mode to alternate between the current color and the new specified color. PostScript does not support XOR mode.

Specified by:
setXORMode in class Graphics
Parameters:
c1 - the second color Note: setXORMode not supported by PostScript

getFont

public Font getFont()
Gets the current font.

Specified by:
getFont in class Graphics
See Also:
setFont(java.awt.Font)

setFont

public void setFont(Font font)
Sets the font for all subsequent text-drawing operations.

Specified by:
setFont in class Graphics
Parameters:
font - the specified font

emitFont

protected String emitFont(Font font)
Send the set font command to output.


getBaseFontName

public String getBaseFontName(String fontname,
                              Font font)
Get Base font name, if font name is wide char string, just use the font name with US locale.


getFontMetrics

public FontMetrics getFontMetrics()
Gets the current font metrics.

Overrides:
getFontMetrics in class Graphics
See Also:
getFont()

getFontMetrics

public FontMetrics getFontMetrics(Font f)
Gets the current font metrics for the specified font.

Specified by:
getFontMetrics in class Graphics
Parameters:
f - the specified font
See Also:
getFont(), getFontMetrics()

getClipBounds

public Rectangle getClipBounds()
Returns the bounding rectangle of the current clipping area. The coordinates in the rectangle are relative to the coordinate system origin of this graphics context.

Specified by:
getClipBounds in class Graphics
Returns:
the bounding rectangle of the current clipping area.

getClip

public Shape getClip()
Gets the current clipping area.

Specified by:
getClip in class Graphics
Returns:
a Shape object representing the current clipping area.

clipRect

public void clipRect(int x,
                     int y,
                     int width,
                     int height)
Clips to a rectangle. The resulting clipping area is the intersection of the current clipping area and the specified rectangle. Graphic operations have no effect outside of the clipping area.

Specified by:
clipRect in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
See Also:
Graphics.getClipRect()

clipRect

public void clipRect(double x,
                     double y,
                     double width,
                     double height)

setClip

public void setClip(int x,
                    int y,
                    int width,
                    int height)
Sets the current clip to the rectangle specified by the given coordinates. Rendering operations have no effect outside of the clipping area.

Specified by:
setClip in class Graphics
Parameters:
x - the x coordinate of the new clip rectangle.
y - the y coordinate of the new clip rectangle.
width - the width of the new clip rectangle.
height - the height of the new clip rectangle.

setClip

public void setClip(double x,
                    double y,
                    double width,
                    double height)

emitClip

protected void emitClip(double x,
                        double y,
                        double width,
                        double height)

copyArea

public void copyArea(int x,
                     int y,
                     int width,
                     int height,
                     int dx,
                     int dy)
Copies an area of the screen.

Specified by:
copyArea in class Graphics
Parameters:
x - the x-coordinate of the source
y - the y-coordinate of the source
width - the width
height - the height
dx - the horizontal distance
dy - the vertical distance Note: copyArea not supported by PostScript

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Draws a line between the coordinates (x1,y1) and (x2,y2). The line is drawn below and to the left of the logical coordinates.

Specified by:
drawLine in class Graphics
Parameters:
x1 - the first point's x coordinate
y1 - the first point's y coordinate
x2 - the second point's x coordinate
y2 - the second point's y coordinate

drawLine

public void drawLine(double x1,
                     double y1,
                     double x2,
                     double y2)

drawPolyline

public void drawPolyline(int[] xPoints,
                         int[] yPoints,
                         int nPoints)
Draws a sequence of connected lines defined by arrays of x and y coordinates. Each pair of (xy) coordinates defines a point. The figure is not closed if the first point differs from the last point.

Specified by:
drawPolyline in class Graphics
Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points

drawPolyline

public void drawPolyline(float[] xPoints,
                         float[] yPoints,
                         int nPoints)
Draws a sequence of connected lines defined by arrays of x and y coordinates. Each pair of (xy) coordinates defines a point. The figure is not closed if the first point differs from the last point.

Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points

fillRect

public void fillRect(int x,
                     int y,
                     int width,
                     int height)
Fills the specified rectangle with the current color.

Specified by:
fillRect in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
See Also:
drawRect(int, int, int, int), clearRect(int, int, int, int)

fillRect

public void fillRect(double x,
                     double y,
                     double width,
                     double height)

drawRect

public void drawRect(int x,
                     int y,
                     int width,
                     int height)
Draws the outline of the specified rectangle using the current color. Use drawRect(x, y, width-1, height-1) to draw the outline inside the specified rectangle.

Overrides:
drawRect in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
See Also:
fillRect(int, int, int, int), clearRect(int, int, int, int)

drawRect

public void drawRect(double x,
                     double y,
                     double width,
                     double height)

clearRect

public void clearRect(int x,
                      int y,
                      int width,
                      int height)
Clears the specified rectangle by filling it with the current background color of the current drawing surface. Which drawing surface it selects depends on how the graphics context was created.

Specified by:
clearRect in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
See Also:
fillRect(int, int, int, int), drawRect(int, int, int, int)

clearRect

public void clearRect(double x,
                      double y,
                      double width,
                      double height)

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Draws an outlined rounded corner rectangle using the current color.

Specified by:
drawRoundRect in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
arcWidth - the diameter of the arc
arcHeight - the radius of the arc
See Also:
fillRoundRect(int, int, int, int, int, int)

drawRoundRect

public void drawRoundRect(double x,
                          double y,
                          double width,
                          double height,
                          double arcWidth,
                          double arcHeight)

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int width,
                          int height,
                          int arcWidth,
                          int arcHeight)
Draws a rounded rectangle filled in with the current color.

Specified by:
fillRoundRect in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
arcWidth - the diameter of the arc
arcHeight - the radius of the arc
See Also:
drawRoundRect(int, int, int, int, int, int)

fillRoundRect

public void fillRoundRect(double x,
                          double y,
                          double width,
                          double height,
                          double arcWidth,
                          double arcHeight)

draw3DRect

public void draw3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Draws a highlighted 3-D rectangle.

Overrides:
draw3DRect in class Graphics2D
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
raised - a boolean that states whether the rectangle is raised or not.

draw3DRect

public void draw3DRect(double x,
                       double y,
                       double width,
                       double height,
                       boolean raised)

fill3DRect

public void fill3DRect(int x,
                       int y,
                       int width,
                       int height,
                       boolean raised)
Paints a highlighted 3-D rectangle using the current color.

Overrides:
fill3DRect in class Graphics2D
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
raised - a boolean that states whether the rectangle is raised or not.

fill3DRect

public void fill3DRect(double x,
                       double y,
                       double width,
                       double height,
                       boolean raised)

drawOval

public void drawOval(int x,
                     int y,
                     int width,
                     int height)
Draws an oval inside the specified rectangle using the current color.

Specified by:
drawOval in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
See Also:
fillOval(int, int, int, int)

drawOval

public void drawOval(double x,
                     double y,
                     double width,
                     double height)

fillOval

public void fillOval(int x,
                     int y,
                     int width,
                     int height)
Fills an oval inside the specified rectangle using the current color.

Specified by:
fillOval in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
See Also:
drawOval(int, int, int, int)

fillOval

public void fillOval(double x,
                     double y,
                     double width,
                     double height)

drawArc

public void drawArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Draws an arc bounded by the specified rectangle from startAngle to endAngle. 0 degrees is at the 3-o'clock position.Positive arc angles indicate counter-clockwise rotations, negative arc angles are drawn clockwise.

Specified by:
drawArc in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
startAngle - the beginning angle
arcAngle - the angle of the arc (relative to startAngle).
See Also:
fillArc(int, int, int, int, int, int)

drawArc

public void drawArc(double x,
                    double y,
                    double width,
                    double height,
                    double startAngle,
                    double arcAngle,
                    int arcType)

fillArc

public void fillArc(int x,
                    int y,
                    int width,
                    int height,
                    int startAngle,
                    int arcAngle)
Fills an arc using the current color. This generates a pie shape.

Specified by:
fillArc in class Graphics
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the arc
height - the height of the arc
startAngle - the beginning angle
arcAngle - the angle of the arc (relative to startAngle).
See Also:
drawArc(int, int, int, int, int, int)

fillArc

public void fillArc(double x,
                    double y,
                    double width,
                    double height,
                    double startAngle,
                    double arcAngle)

drawPolygon

public void drawPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Draws a polygon defined by an array of x points and y points.

Specified by:
drawPolygon in class Graphics
Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
See Also:
fillPolygon(int[], int[], int)

drawPolygon

public void drawPolygon(Polygon p)
Draws a polygon defined by the specified point.

Overrides:
drawPolygon in class Graphics
Parameters:
p - the specified polygon
See Also:
fillPolygon(int[], int[], int)

fillPolygon

public void fillPolygon(int[] xPoints,
                        int[] yPoints,
                        int nPoints)
Fills a polygon with the current color.

Specified by:
fillPolygon in class Graphics
Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
See Also:
drawPolygon(int[], int[], int)

fillPolygon

public void fillPolygon(Polygon p)
Fills the specified polygon with the current color.

Overrides:
fillPolygon in class Graphics
Parameters:
p - the polygon
See Also:
drawPolygon(int[], int[], int)

drawString

public void drawString(String str,
                       int sx,
                       int sy)
Draws the specified String using the current font and color. The x,y position is the starting point of the baseline of the String.

Specified by:
drawString in class Graphics2D
Parameters:
str - the String to be drawn
sx - the x coordinate
sy - the y coordinate

drawString

public void drawString(String str,
                       float sx,
                       float sy)
Specified by:
drawString in class Graphics2D

drawString

public char[] drawString(String str,
                         double sx,
                         double sy)
Draw string with double coordinate values.


emitTj

protected void emitTj(String txt)
Output the Tj command.


stringWidth

protected float stringWidth(String str)
Return the string width.


drawChars

public void drawChars(char[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Draws the specified characters using the current font and color.

Overrides:
drawChars in class Graphics
Parameters:
data - the array of characters to be drawn
offset - the start offset in the data
length - the number of characters to be drawn
x - the x coordinate
y - the y coordinate
See Also:
drawString(java.lang.String, int, int), drawBytes(byte[], int, int, int, int)

drawBytes

public void drawBytes(byte[] data,
                      int offset,
                      int length,
                      int x,
                      int y)
Draws the specified bytes using the current font and color.

Overrides:
drawBytes in class Graphics
Parameters:
data - the data to be drawn
offset - the start offset in the data
length - the number of bytes that are drawn
x - the x coordinate
y - the y coordinate
See Also:
drawString(java.lang.String, int, int), drawChars(char[], int, int, int, int)

doImage

public boolean doImage(Image img,
                       int x,
                       int y,
                       int width,
                       int height,
                       ImageObserver observer,
                       Color bgcolor)
Draw image.


doImage

public boolean doImage(Image img,
                       int x,
                       int y,
                       int width,
                       int height,
                       int sx1,
                       int sy1,
                       int sx2,
                       int sy2,
                       ImageObserver observer,
                       Color bgcolor)
Draw image.


emitImage

protected int emitImage(inetsoft.util.PixelConsumer pc,
                        int x,
                        int y,
                        Dimension isize,
                        ImageObserver observer,
                        Color bgcolor)
Create an image object.

Returns:
image id.

emitImage

protected int emitImage(inetsoft.report.internal.MetaImage image,
                        int x,
                        int y,
                        Dimension isize,
                        Color bgcolor)
                 throws IOException
Create an image object from a jpeg.

Returns:
image id.
Throws:
IOException

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         ImageObserver observer)
Draws the specified image at the specified coordinate (x, y). If the image is incomplete the image observer will be notified later.

Specified by:
drawImage in class Graphics
Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
observer - notifies if the image is complete or not
See Also:
Image, ImageObserver

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         ImageObserver observer)
Draws the specified image inside the specified rectangle. The image is scaled if necessary. If the image is incomplete the image observer will be notified later.

Specified by:
drawImage in class Graphics
Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
observer - notifies if the image is complete or not
See Also:
Image, ImageObserver

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         Color bgcolor,
                         ImageObserver observer)
Draws the specified image at the specified coordinate (x, y). If the image is incomplete the image observer will be notified later.

Specified by:
drawImage in class Graphics
Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
bgcolor - the background color
observer - notifies if the image is complete or not
See Also:
Image, ImageObserver

drawImage

public boolean drawImage(Image img,
                         int x,
                         int y,
                         int width,
                         int height,
                         Color bgcolor,
                         ImageObserver observer)
Draws the specified image inside the specified rectangle. The image is scaled if necessary. If the image is incomplete the image observer will be notified later.

Specified by:
drawImage in class Graphics
Parameters:
img - the specified image to be drawn
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
bgcolor - the background color
observer - notifies if the image is complete or not
See Also:
Image, NOTE: PDFPrinter ignores the background color.

drawImage

public boolean drawImage(Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface. Transparent pixels do not affect whatever pixels are already there.

This method returns immediately in all cases, even if the image area to be drawn has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete then drawImage returns false. As more of the image becomes available, the process that draws the image notifies the specified image observer.

This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.

Specified by:
drawImage in class Graphics
Parameters:
img - the specified image to be drawn
dx1 - the x coordinate of the first corner of the destination rectangle.
dy1 - the y coordinate of the first corner of the destination rectangle.
dx2 - the x coordinate of the second corner of the destination rectangle.
dy2 - the y coordinate of the second corner of the destination rectangle.
sx1 - the x coordinate of the first corner of the source rectangle.
sy1 - the y coordinate of the first corner of the source rectangle.
sx2 - the x coordinate of the second corner of the source rectangle.
sy2 - the y coordinate of the second corner of the source rectangle.
observer - object to be notified as more of the image is scaled and converted.

drawImage

public boolean drawImage(Image img,
                         int dx1,
                         int dy1,
                         int dx2,
                         int dy2,
                         int sx1,
                         int sy1,
                         int sx2,
                         int sy2,
                         Color bgcolor,
                         ImageObserver observer)
Draws as much of the specified area of the specified image as is currently available, scaling it on the fly to fit inside the specified area of the destination drawable surface.

Transparent pixels are drawn in the specified background color. This operation is equivalent to filling a rectangle of the width and height of the specified image with the given color and then drawing the image on top of it, but possibly more efficient.

This method returns immediately in all cases, even if the image area to be drawn has not yet been scaled, dithered, and converted for the current output device. If the current output representation is not yet complete then drawImage returns false. As more of the image becomes available, the process that draws the image notifies the specified image observer.

This method always uses the unscaled version of the image to render the scaled rectangle and performs the required scaling on the fly. It does not use a cached, scaled version of the image for this operation. Scaling of the image from source to destination is performed such that the first coordinate of the source rectangle is mapped to the first coordinate of the destination rectangle, and the second source coordinate is mapped to the second destination coordinate. The subimage is scaled and flipped as needed to preserve those mappings.

Specified by:
drawImage in class Graphics
Parameters:
img - the specified image to be drawn
dx1 - the x coordinate of the first corner of the destination rectangle.
dy1 - the y coordinate of the first corner of the destination rectangle.
dx2 - the x coordinate of the second corner of the destination rectangle.
dy2 - the y coordinate of the second corner of the destination rectangle.
sx1 - the x coordinate of the first corner of the source rectangle.
sy1 - the y coordinate of the first corner of the source rectangle.
sx2 - the x coordinate of the second corner of the source rectangle.
sy2 - the y coordinate of the second corner of the source rectangle.
bgcolor - the background color to paint under the non-opaque portions of the image.
observer - object to be notified as more of the image is scaled and converted.

dispose

public void dispose()
Disposes of this graphics context. The Graphics context cannot be used after being disposed of. This must be called EXPLICITLY after a Graphics object is no longer used.

Specified by:
dispose in class Graphics

close

public void close()
Close the pdf output stream. This MUST be called to complete the file.

Specified by:
close in interface PDFDevice

emit

public void emit(String cmd)
Emit a PDF command to the output stream.


gsave

public void gsave(int level)
PDF save. Save graphics context up-to the specified level.


grestore

public int grestore(int level)
Restore graphics context up-to the specified level.


addLink

public Integer addLink(Hyperlink.Ref link,
                       Rectangle linkBounds,
                       double pgH,
                       Map actions,
                       int page,
                       boolean flush)
Adds an annotation for a link.

Parameters:
link - the target of the hyperlink.
linkBounds - the bounds of the linked element.
pgH - the page height.
actions - map of action ids to internal targets.
page - the page index (zero-based).
flush - true to flush the object buffer.
Returns:
the ID of the link annotation or null if none was created.

addAnnotation

public void addAnnotation(int id,
                          int page)
Add an annotation to the PDF.

Parameters:
id - the annotation id
page - the page the annotation is being added to

addObject

public void addObject(int id,
                      String obj)
Add an object to the PDF.


addObject

public void addObject(int id,
                      String obj,
                      boolean flush)
Add an object to the PDF.


writeAnnotations

protected void writeAnnotations()
Write out the annotations.


writeOthers

protected void writeOthers()
flush out the others buffer.


writeAdditionalResources

protected void writeAdditionalResources(PrintWriter os)
This function is called to allow additional resources to be written to the current page.


startDoc

public void startDoc()
Initialize file.


writeEncoding

protected int writeEncoding(int idx)
Write the encoding object


setLineWidth

public void setLineWidth(float w)
Set the line width in points.


checkTextObj

public void checkTextObj(boolean txt)
Make sure currently in the text segment (BT-ET).

Parameters:
txt - true to make in a text segment or false to end text object.

getPDFVersion

public String getPDFVersion()
Return the PDF version of the documents generated by this class. Acrobat 3.0 is PDF 1.2, and Acrobat 4.0 is PDF 1.3.

Returns:
PDF version number, e.g., "1.2".

toString

public String toString()
Returns a String object representing this Graphic's value.

Overrides:
toString in class Graphics

transformY

protected final double transformY(double y)
Flip Y coords so PDFPrinter looks like Java.


transformX

protected final double transformX(double x)
Translate Java coordinate to PDF coordinate.


getNaturalLanguage

protected String getNaturalLanguage()
Writes the natural language attribute for the catalog dictionary.

Returns:
the natural language attribute or null if not supported in this version of the PDF specification.

getNextFontIndex

protected int getNextFontIndex()
Get the next font index.


getNextObjectID

public int getNextObjectID()
Get the next objectID.


getNextPatternID

public int getNextPatternID()
Get the next objectID.


startPage

protected final void startPage()
Initialize a new page.


writeGradientPaint

public int writeGradientPaint(GradientPaint gpaint)
Write pattern object.


writePattern

public int writePattern(Image img)
Write pattern object.


isBase14Font

protected boolean isBase14Font(String fontin)
Check if a font is base14 font.


getPSFontNameWithInsetx

protected String getPSFontNameWithInsetx(String pfname,
                                         int ix)
Return the PS Font Name with insetx as suffix.


isInsetxNeeded

protected boolean isInsetxNeeded(String pfname,
                                 int ix)

splitWords

public static String[] splitWords(String str)
Split delimited string into array of words.


getPrinterJob

public PrinterJob getPrinterJob()
Returns the PrinterJob that is controlling the current rendering request.

Returns:
the PrinterJob controlling the current rendering request.

setPrinterJob

public void setPrinterJob(PrinterJob job)
Set the printer job associated with this graphics.


draw

public void draw(Shape s)
Draw a shape.

Specified by:
draw in class Graphics2D

drawImage

public boolean drawImage(Image img,
                         AffineTransform xform,
                         ImageObserver obs)
Draw image.

Specified by:
drawImage in class Graphics2D

drawImage

public void drawImage(BufferedImage img,
                      BufferedImageOp op,
                      int x,
                      int y)
Draw image.

Specified by:
drawImage in class Graphics2D

drawRenderedImage

public void drawRenderedImage(RenderedImage img,
                              AffineTransform xform)
Draw image.

Specified by:
drawRenderedImage in class Graphics2D

drawRenderableImage

public void drawRenderableImage(RenderableImage img,
                                AffineTransform xform)
Draw image.

Specified by:
drawRenderableImage in class Graphics2D

drawString

public void drawString(AttributedCharacterIterator iterator,
                       int x,
                       int y)
Draw string.

Specified by:
drawString in class Graphics2D

drawString

public void drawString(AttributedCharacterIterator iterator,
                       float x,
                       float y)
Draw string.

Specified by:
drawString in class Graphics2D

drawGlyphVector

public void drawGlyphVector(GlyphVector g,
                            float x,
                            float y)
Draw string.

Specified by:
drawGlyphVector in class Graphics2D

fill

public void fill(Shape s)
Fill shape.

Specified by:
fill in class Graphics2D

setPaint

public void setPaint(Paint paint)
Set the brush of painting.

Specified by:
setPaint in class Graphics2D

hit

public boolean hit(Rectangle rect,
                   Shape s,
                   boolean onStroke)
Not supported.

Specified by:
hit in class Graphics2D

setStroke

public void setStroke(Stroke s)
Set the painting pen.

Specified by:
setStroke in class Graphics2D

setRenderingHint

public void setRenderingHint(RenderingHints.Key hintKey,
                             Object hintValue)
Not supported.

Specified by:
setRenderingHint in class Graphics2D

getRenderingHint

public Object getRenderingHint(RenderingHints.Key hintKey)
Not supported.

Specified by:
getRenderingHint in class Graphics2D

setRenderingHints

public void setRenderingHints(Map hints)
Not supported.

Specified by:
setRenderingHints in class Graphics2D

addRenderingHints

public void addRenderingHints(Map hints)
Not supported.

Specified by:
addRenderingHints in class Graphics2D

getRenderingHints

public RenderingHints getRenderingHints()
Not supported.

Specified by:
getRenderingHints in class Graphics2D

translate

public void translate(int x,
                      int y)
Specified by:
translate in class Graphics2D

translate

public void translate(double x,
                      double y)
Specified by:
translate in class Graphics2D

getDeviceConfiguration

public GraphicsConfiguration getDeviceConfiguration()
Not supported.

Specified by:
getDeviceConfiguration in class Graphics2D

setComposite

public void setComposite(Composite comp)
Sets the Composite for the Graphics2D context. The Composite is used in all drawing methods such as drawImage, drawString,draw, and fill. It specifies how new pixels are to be combined with the existing pixels on the graphics device during the rendering process.

Specified by:
setComposite in class Graphics2D

rotate

public void rotate(double theta)
Specified by:
rotate in class Graphics2D

rotate

public void rotate(double theta,
                   double x,
                   double y)
Specified by:
rotate in class Graphics2D

scale

public void scale(double sx,
                  double sy)
Specified by:
scale in class Graphics2D

shear

public void shear(double shx,
                  double shy)
Specified by:
shear in class Graphics2D

transform

public void transform(AffineTransform tx)
Specified by:
transform in class Graphics2D

setTransform

public void setTransform(AffineTransform tx)
Specified by:
setTransform in class Graphics2D

getTransform

public AffineTransform getTransform()
Specified by:
getTransform in class Graphics2D

emitcm

protected void emitcm(AffineTransform tx)
Output a matrix command.


getPaint

public Paint getPaint()
Specified by:
getPaint in class Graphics2D

getComposite

public Composite getComposite()
Specified by:
getComposite in class Graphics2D

getStroke

public Stroke getStroke()
Specified by:
getStroke in class Graphics2D

isSupported

public boolean isSupported(int feature)
Specified by:
isSupported in interface inetsoft.report.internal.CustomGraphics

setClip

public void setClip(Shape s)
Specified by:
setClip in class Graphics

clip

public void clip(Shape s)
Specified by:
clip in class Graphics2D

getFontRenderContext

public FontRenderContext getFontRenderContext()
Specified by:
getFontRenderContext in class Graphics2D

transformRect

protected final void transformRect(Rectangle2D.Double rect,
                                   boolean reverse)

writePatternResources

protected void writePatternResources(PrintWriter os)
Write the pattern resources.


isCurrentCJKFont

protected boolean isCurrentCJKFont()
Check if current using font is CJK font.


clone

public Object clone()
Overrides:
clone in class Object

debug

protected void debug(PDFPrinter.PDFWriter os,
                     String m)

containsArabicCombinCharacter

protected boolean containsArabicCombinCharacter()

setMac

public void setMac(boolean isMac)

setStructurePart

public void setStructurePart(PDFPrinter.StructurePart structurePart)
Set which page part is being processed.

Parameters:
structurePart - the StructurePart of the page

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.