Save This Page
Home » pentaho-reporting-engine-classic-0.8.10 » org.jfree.report.modules.output.pageable » pdf » [javadoc | source]
org.jfree.report.modules.output.pageable.pdf
public class: PDFOutputTarget [javadoc | source]
java.lang.Object
   org.jfree.report.modules.output.pageable.base.output.AbstractOutputTarget
      org.jfree.report.modules.output.pageable.pdf.PDFOutputTarget

All Implemented Interfaces:
    OutputTarget

An output target for the report engine that generates a PDF file using the iText class library (see http://www.lowagie.com/iText, note that the URL is case-sensitive!).

If the system property "org.jfree.report.modules.output.pageable.pdf.PDFOutputTarget.AUTOINIT" is set to "true", the PDF-FontFactory is automatically initialized when this class is loaded. Be aware that embedding many fonts will result in larger files.

When using Unicode characters, you will have to adjust the encoding of this target to "Identity-H", to enable horizontal unicode printing. This will result in larger files.

The Encoding property is now a string with one of the values of "none" "40bit" or "128bit".

Field Summary
public static final  String CONFIGURATION_PREFIX    The configuration prefix. 
public static final  String EMBED_FONTS    Literal text for the 'EmbedFonts' property name. 
public static final  String SECURITY_ALLOW_PRINTING    Literal text for the 'AllowPrinting' property name. 
public static final  String SECURITY_ALLOW_MODIFY_CONTENTS    Literal text for the 'AllowModifyContents' property name. 
public static final  String SECURITY_ALLOW_COPY    Literal text for the 'AllowCopy' property name. 
public static final  String SECURITY_ALLOW_MODIFY_ANNOTATIONS    Literal text for the 'AllowModifyAnnotations' property name. 
public static final  String SECURITY_ALLOW_FILLIN    Literal text for the 'AllowFillIn' property name. 
public static final  String SECURITY_ALLOW_SCREENREADERS    Literal text for the 'AllowScreenReaders' property name. 
public static final  String SECURITY_ALLOW_ASSEMBLY    Literal text for the 'AllowAssembly' property name. 
public static final  String SECURITY_ALLOW_DEGRADED_PRINTING    Literal text for the 'AllowDegradedPrinting' property name. 
public static final  String SECURITY_ENCRYPTION    Literal text for the 'Encryption' property name. 
public static final  String SECURITY_ENCRYPTION_NONE    A constant for the encryption type (40 bit). 
public static final  String SECURITY_ENCRYPTION_40BIT    A constant for the encryption type (40 bit). 
public static final  String SECURITY_ENCRYPTION_128BIT    A constant for the encryption type (128 bit). 
public static final  String SECURITY_USERPASSWORD    Literal text for the 'userpassword' property name. 
public static final  String SECURITY_OWNERPASSWORD    Literal text for the 'ownerpassword' property name. 
public static final  String ENCODING    The encoding key. 
public static final  String PDFTARGET_EMBED_FONTS    The 'PDF embed fonts' property key. 
public static final  String PDFTARGET_EMBED_FONTS_DEFAULT    The default 'PDF embed fonts' property value. 
public static final  String PDFTARGET_ENCODING    The 'PDF encoding' property key. 
public static final  String PDFTARGET_ENCODING_DEFAULT    The default 'PDF encoding' property value. 
public static final  String PDF_VERSION    The pdf specification version that should be created. 
public static final  String PDFTARGET_PDF_VERSION    The global key name for the pdf specification version that should be created. 
public static final  String PDF_VERSION_DEFAULT    The default version number for the PDF specification version. 
Constructor:
 public PDFOutputTarget(OutputStream out,
    PageFormat pageFormat) 
    Constructs a PDFOutputTarget.
    Parameters:
    out - the output stream.
    pageFormat - the page format.
 public PDFOutputTarget(OutputStream out,
    LogicalPage logPage) 
    Creates a new PDFOutputTarget.
    Parameters:
    out - the output stream.
    logPage - the logical page.
 public PDFOutputTarget(OutputStream out,
    PageFormat pageFormat,
    boolean embedFonts) 
    Constructs a PDFOutputTarget.
    Parameters:
    out - the output stream.
    pageFormat - the page format.
    embedFonts - embed fonts?
 public PDFOutputTarget(OutputStream out,
    LogicalPage logPage,
    boolean embedFonts) 
    Creates a new PDFOutputTarget.
    Parameters:
    out - the output stream.
    logPage - the logical page.
    embedFonts - embed the fonts?
 public PDFOutputTarget(OutputStream out,
    PageFormat logPageFormat,
    PageFormat physPageFormat) 
    Creates a new PDFOutputTarget.
    Parameters:
    out - the output stream.
    logPageFormat - the logical page format.
    physPageFormat - the physical page format.
 public PDFOutputTarget(OutputStream out,
    PageFormat logPageFormat,
    PageFormat physPageFormat,
    boolean embedFonts) 
    Creates a new PDFOutputTarget.
    Parameters:
    out - the output stream.
    logPageFormat - the logical page format.
    physPageFormat - the physical page format.
    embedFonts - embed the fonts?
Method from org.jfree.report.modules.output.pageable.pdf.PDFOutputTarget Summary:
beginPage,   close,   configure,   createDummyWriter,   createTextSizeCalculator,   drawDrawable,   drawImage,   drawShape,   drawString,   endPage,   fillShape,   getBaseFont,   getDefaultPDFEncoding,   getFont,   getPaint,   getStroke,   isDefaultEmbedFonts,   isOpen,   open,   setDefaultEmbedFonts,   setDefaultPDFEncoding,   setFont,   setFontEncoding,   setOperationBounds,   setPaint,   setStroke
Methods from org.jfree.report.modules.output.pageable.base.output.AbstractOutputTarget:
createContentFactory,   getContentFactory,   getHorizontalAlignmentBorder,   getLogicalPage,   getOperationBounds,   getProperty,   getProperty,   getPropertyNames,   getVerticalAlignmentBorder,   setOperationBounds,   setProperty
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.report.modules.output.pageable.pdf.PDFOutputTarget Detail:
 public  void beginPage(PhysicalPage format) 
    Signals that a page is being started. Stores the state of the target to make it possible to restore the complete outputtarget.
 public  void close() 
    Closes the document.
 public  void configure(ReportConfiguration config) 
    Configures the output target.
 public OutputTarget createDummyWriter() 
    Creates an output target that mimics a real output target, but produces no output. This is used by the reporting engine when it makes its first pass through the report, calculating page boundaries etc. The second pass will use a real output target.
 public SizeCalculator createTextSizeCalculator(FontDefinition font) throws OutputTargetException 
    Creates a 'size calculator' for the current state of the output target. The calculator is used to calculate the string width and line height and later maybe more.
 public  void drawDrawable(DrawableContainer drawable) 
    Draws a drawable relative to the current position.
 public  void drawImage(ImageReference imageRef) throws OutputTargetException 
    Draws an image from this ImageReference . The image is directly embedded into the pdf file to provide the best scaling support.
 public  void drawShape(Shape shape) 
    Draws a shape at the specified location. The shape is drawn using a PathIterator. All Shapes are supported. Set a stroke and a paint before drawing. The shape is not filled.
 public  void drawString(String text) 
    Draws the band onto the specified graphics device. The Text is printed on the bottom of the elements bounds.
 public  void endPage() throws OutputTargetException 
    This method is called when the page is ended.
 public  void fillShape(Shape shape) 
    Draws a shape at the specified location. The shape is drawn using a PathIterator. All Shapes are supported. Set a stroke and a paint before drawing. The shape is filled using the current paint and no outline is drawn.
 public BaseFont getBaseFont() 
    Returns the iText BaseFont.
 public static String getDefaultPDFEncoding() 
    Returns the PDF encoding property value.
 public FontDefinition getFont() 
    Returns the currently active AWT-Font.
 public Paint getPaint() 
    Returns the currently set paint.
 public Stroke getStroke() 
    Returns the current stroke.
 public static boolean isDefaultEmbedFonts() 
    Returns true, if the Graphics2D should use aliasing to render text. Defaults to false.
 public boolean isOpen() 
    Returns true if the output target is open, and false otherwise.
 public  void open() throws OutputTargetException 
    Opens the document.
 public static  void setDefaultEmbedFonts(boolean embed) 
    set to true, if the PDFOutputTarget should embed all fonts.
 public static  void setDefaultPDFEncoding(String pdfTargetEncoding) 
    Sets the PDF encoding property value.
 public  void setFont(FontDefinition font) throws OutputTargetException 
    Sets the current font. The font is mapped to pdf specific fonts if possible. If no basefont could be created, an OutputTargetException is thrown.
 public  void setFontEncoding(String encoding) 
    Defines the text encoding used in this output target.
    • The Unicode encoding with horizontal writing is "Identity-H"
    • The Unicode encoding with vertical writing is "Identity-V"
    • "Cp1250"
    • "Cp1252" is also known as WinAnsi
    • "Cp1257"
    • "MacRoman"
 public  void setOperationBounds(Rectangle2D bounds) 
    Sets the operation bounds.
 public  void setPaint(Paint paint) throws OutputTargetException 
    Sets the paint. If the paint could not be converted into a pdf object, an OutputTargetException is thrown. This implementation currently supports java.awt.Color as the only valid paint.
 public  void setStroke(Stroke stroke) throws OutputTargetException 
    Defines the stroke used to draw shapes. If the stroke is of an invalid type, an OutputTargetException is thrown. Currently only BasicStroke is supported.