Style Intelligence v12.0

inetsoft.report
Class PSPrinter

java.lang.Object
  extended by java.awt.Graphics
      extended by java.awt.Graphics2D
          extended by inetsoft.report.internal.PSGraphics
              extended by inetsoft.report.PSPrinter
All Implemented Interfaces:
inetsoft.report.internal.CustomGraphics, PrintGraphics, Serializable, Cloneable

public class PSPrinter
extends inetsoft.report.internal.PSGraphics
implements PrintGraphics

PSPrinter is a Graphics subclass that can be used to print a report to a postscript file. This class is normally used to generate output that can be send to a postscript printer. For portable document output, use PDF instead. It is more compact and accurate.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class inetsoft.report.internal.PSGraphics
pageheight, pagewidth, RESOLUTION, sfactor, writer
 
Fields inherited from interface inetsoft.report.internal.CustomGraphics
G_DASH_LINE, JPEG_EXPORT
 
Constructor Summary
protected PSPrinter()
          PSPrinter should not be created directly.
  PSPrinter(File outf)
          Construct a PSPrinter graphics content.
  PSPrinter(OutputStream o)
          Constructs a new PSPrinter Object.
  PSPrinter(String cmd)
          Constructs a new PSPrinter Object.
  PSPrinter(String[] cmd)
          Constructs a new PSPrinter Object.
 
Method Summary
 int getOrientation()
          Returns the orientation of this PageFormat.
 Dimension getPageDimension()
          Returns the dimensions of the page in pixels.
 Size getPageSize()
          Get the page size in inches.
 PrintJob getPrintJob()
          Get the printjob object associated with this object, which contains the page size and resolution information.
 boolean isCompressImage()
          Check if compression is on.
 void setCompressImage(boolean comp)
          Set whether to compress the image object and streams in the PS.
 void setOrientation(int orientation)
          Sets the page orientation.
 void setOutput(OutputStream os)
          Set the output of this print job.
 void setPageSize(double width, double height)
          Set the page size in inches.
 void setPageSize(Size size)
          Set the page size in inches.
 
Methods inherited from class inetsoft.report.internal.PSGraphics
addRenderingHints, clearRect, clearRect, clip, clipRect, clipRect, close, copyArea, create, create, dispose, doImage, doImage, draw, draw3DRect, draw3DRect, drawArc, drawArc, drawBytes, drawChars, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawLine, drawOval, drawOval, drawPolygon, drawPolygon, drawPolyline, drawPolyline, drawRect, drawRect, drawRenderableImage, drawRenderedImage, drawRoundRect, drawRoundRect, drawString, drawString, drawString, drawString, drawString, emit, escapeString, fill, fill3DRect, fill3DRect, fillArc, fillArc, fillOval, fillOval, fillPolygon, fillPolygon, fillRect, fillRect, fillRoundRect, fillRoundRect, finalize, flush, getBackground, getClip, getClipBounds, getColor, getComposite, getDeviceConfiguration, getFont, getFontMetrics, getFontMetrics, getFontName, getFontRenderContext, getPaint, getPrinterJob, getRenderingHint, getRenderingHints, getStroke, getTransform, grestore, gsave, hit, isCompleted, isSupported, putFontName, reset, rotate, rotate, rtransformX, rtransformY, scale, setBackground, setClip, setClip, setClip, setColor, setCompleted, setComposite, setFont, setPaint, setPaintMode, setPrinterJob, setRenderingHint, setRenderingHints, setStroke, setTransform, setXORMode, shear, startDoc, startDoc, startPage, toString, transform, transformX, transformY, translate, translate
 
Methods inherited from class java.awt.Graphics
getClipBounds, getClipRect, hitClip
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PSPrinter

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

Parameters:
outf - output file.
Throws:
IOException

PSPrinter

public PSPrinter(String cmd)
          throws IOException
Constructs a new PSPrinter Object. Unlike regular Graphics objects, PSPrinter contexts can be created directly. The command is used to accept the output (postscript file). It can be a print command such as 'lpr' that pass the postscript to a printer.

Parameters:
cmd - print command.
Throws:
IOException

PSPrinter

public PSPrinter(String[] cmd)
          throws IOException
Constructs a new PSPrinter Object. Unlike regular Graphics objects, PSPrinter contexts can be created directly. The command is used to accept the output (postscript file). It can be a print command such as 'lpr' that pass the postscript to a printer.

Parameters:
cmd - print command.
Throws:
IOException

PSPrinter

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

Parameters:
o - Output stream for PostScript output
See Also:
PSGraphics.create()

PSPrinter

protected PSPrinter()
PSPrinter should not be created directly.

Method Detail

setOutput

public void setOutput(OutputStream os)
Set the output of this print job.

Overrides:
setOutput in class inetsoft.report.internal.PSGraphics

setCompressImage

public void setCompressImage(boolean comp)
Set whether to compress the image object and streams in the PS. If compression is on, the generated postscript is compatible with PS level 2. By default this is true.

Overrides:
setCompressImage in class inetsoft.report.internal.PSGraphics
Parameters:
comp - compression option.

isCompressImage

public boolean isCompressImage()
Check if compression is on.

Overrides:
isCompressImage in class inetsoft.report.internal.PSGraphics
Returns:
true if image objects are compressed.

setPageSize

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

Overrides:
setPageSize in class inetsoft.report.internal.PSGraphics
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. If the orientation is set to landscape, the page size should be rotated accordingly. This is different from the StyleReport 1.3 and earlier versions!

Parameters:
size - Size object in inches.

getPageSize

public Size getPageSize()
Get the page size in inches.

Returns:
page size.

getPageDimension

public Dimension getPageDimension()
Returns the dimensions of the page in pixels. The resolution of the page is chosen so that it is similar to the screen resolution.

Overrides:
getPageDimension in class inetsoft.report.internal.PSGraphics

setOrientation

public void setOrientation(int orientation)
Sets the page orientation. orientation must be one of the constants: PORTRAIT, LANDSCAPE.

Specified by:
setOrientation in interface inetsoft.report.internal.CustomGraphics
Overrides:
setOrientation in class inetsoft.report.internal.PSGraphics
Parameters:
orientation - the new orientation for the page

getOrientation

public int getOrientation()
Returns the orientation of this PageFormat.

Overrides:
getOrientation in class inetsoft.report.internal.PSGraphics
Returns:
this PageFormat object's orientation.

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 PrintGraphics
Returns:
print job object.

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