Interface PDFTarget

  • All Superinterfaces:
    RenderTarget

    public interface PDFTarget
    extends RenderTarget
    Rendering target to PDF format.

    This target is used by renderers objects to render a graph to PDF and uses the iText Java library.

    The target give access to the PDFContentBype object from itext to draw items.

    When this target is instanciated it uses property values defined in the PreviewProperties. Namely is uses MARGIN_LEFT, MARGIN_TOP, MARGIN_BOTTOM, MARGIN_RIGHT, LANDCAPE and PAGESIZE.

    Author:
    Yudi Xue, Mathieu Bastian
    • Method Detail

      • getContentByte

        com.itextpdf.text.pdf.PdfContentByte getContentByte()
        Returns the PDFContentBype instance of the PDFTarget. PDFContentByte offers a set of drawing functions which can be used by Renderer objects.
        Returns:
        a PDFContentBype object
      • getBaseFont

        com.itextpdf.text.pdf.BaseFont getBaseFont​(Font font)
        Get a the equivalent in iText of the Java font. Base fonts are either Type 1 fonts (PDF default's font) or valid system fonts. The first time a base font which is not a Type 1 is requested the system will register the system fonts in order to find the right font. This might take some time up to a minute.

        If font can't be found in iText's default fonts or registered fonts it returns the default Helvetica font.

        Parameters:
        font - the reference Java font
        Returns:
        the iText BaseFont, or Helvetica is not found
      • getMarginBottom

        float getMarginBottom()
        Returns the margin at the bottom of the page.
        Returns:
        the bottom margin, in pixels
      • getMarginLeft

        float getMarginLeft()
        Returns the margin at the left of the page.
        Returns:
        the left margin, in pixels
      • getMarginRight

        float getMarginRight()
        Returns the margin at the right of the page.
        Returns:
        the right margin, in pixels
      • getMarginTop

        float getMarginTop()
        Returns the margin at the top of the page.
        Returns:
        the top margin, in pixels
      • isLandscape

        boolean isLandscape()
        Returns whether the orientation is in landscape or portrait.
        Returns:
        true if the orientation is landscape, false if portrait.
      • getPageSize

        com.itextpdf.text.Rectangle getPageSize()
        Returns the page's size.
        Returns:
        the page size