Class PdfDocument


  • public final class PdfDocument
    extends Object
    The pdf document's content model.
    • Method Detail

      • create

        public static PdfDocument create​(org.uberfire.ext.editor.commons.file.exports.PdfExportPreferences settings)
        Factory method that allows custom PDF document's settings. It creates a new PDF document instance using the specified settings.
        Returns:
        A new PDF document instance.
      • addText

        public void addText​(String text,
                            int x,
                            int y)
        Adds text to the document.
        Parameters:
        text - The text to add.
        x - Coordinate (in units declared at inception of PDF document) against left edge of the page.
        y - Coordinate (in units declared at inception of PDF document) against upper edge of the page.
      • addImage

        public void addImage​(String urlData,
                             String imgType,
                             int x,
                             int y,
                             int width,
                             int height)
        Adds an image to the document.
        Parameters:
        urlData - The url data for the image.
        x - Coordinate (in units declared at inception of PDF document) against left edge of the page.
        y - Coordinate (in units declared at inception of PDF document) against upper edge of the page.
        width - The image's width.
        height - The image's height.
      • getSettings

        public org.uberfire.ext.editor.commons.file.exports.PdfExportPreferences getSettings()