Class PdfDrawer

  • All Implemented Interfaces:
    IPdfDrawer

    @Service
    public class PdfDrawer
    extends java.lang.Object
    implements IPdfDrawer
    A drawer service that is able to draw elements to a content stream
    • Constructor Detail

      • PdfDrawer

        public PdfDrawer()
    • Method Detail

      • setupDrawer

        public void setupDrawer​(org.apache.pdfbox.pdmodel.PDDocument pdf,
                                PdfResource pdfResource)
        Specified by:
        setupDrawer in interface IPdfDrawer
      • closeContentStream

        public void closeContentStream()
                                throws java.io.IOException
        Specified by:
        closeContentStream in interface IPdfDrawer
        Throws:
        java.io.IOException
      • closeTemplate

        public void closeTemplate()
                           throws java.io.IOException
        Specified by:
        closeTemplate in interface IPdfDrawer
        Throws:
        java.io.IOException
      • newPage

        public void newPage()
                     throws java.io.IOException
        Specified by:
        newPage in interface IPdfDrawer
        Throws:
        java.io.IOException
      • checkOpenPages

        public void checkOpenPages()
                            throws java.io.IOException
        Specified by:
        checkOpenPages in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawPageNumber

        public void drawPageNumber()
                            throws java.io.IOException
        Specified by:
        drawPageNumber in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawTitleField

        public void drawTitleField​(PdfField field)
                            throws java.io.IOException
        Specified by:
        drawTitleField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawDataGroupField

        public void drawDataGroupField​(PdfField field)
                                throws java.io.IOException
        Specified by:
        drawDataGroupField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawTextField

        public void drawTextField​(PdfField field)
                           throws java.io.IOException
        Specified by:
        drawTextField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawI18nDividerField

        public void drawI18nDividerField​(PdfField field)
                                  throws java.io.IOException
        Specified by:
        drawI18nDividerField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawBooleanField

        public void drawBooleanField​(PdfField field)
                              throws java.io.IOException
        Specified by:
        drawBooleanField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawEnumerationField

        public void drawEnumerationField​(PdfField field)
                                  throws java.io.IOException
        Specified by:
        drawEnumerationField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawMultiChoiceField

        public void drawMultiChoiceField​(PdfField field)
                                  throws java.io.IOException
        Specified by:
        drawMultiChoiceField in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawBooleanBox

        public void drawBooleanBox​(java.util.List<java.lang.String> values,
                                   java.lang.String text,
                                   int x,
                                   int y)
                            throws java.io.IOException
        Specified by:
        drawBooleanBox in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawSelectionButton

        public boolean drawSelectionButton​(java.util.List<java.lang.String> values,
                                           java.lang.String choice,
                                           int x,
                                           int y,
                                           FieldType fieldType)
                                    throws java.io.IOException
        Specified by:
        drawSelectionButton in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawStroke

        public void drawStroke​(int x,
                               int y,
                               int fieldPosY,
                               int width,
                               int lineCounter,
                               float strokeWidth)
                        throws java.io.IOException
        Specified by:
        drawStroke in interface IPdfDrawer
        Throws:
        java.io.IOException
      • drawLine

        public void drawLine​(int x,
                             int y,
                             int fieldPosY,
                             int width,
                             int lineCounter,
                             float strokeWidth,
                             java.awt.Color color)
                      throws java.io.IOException
        Specified by:
        drawLine in interface IPdfDrawer
        Throws:
        java.io.IOException
      • writeString

        public void writeString​(org.apache.pdfbox.pdmodel.font.PDType0Font font,
                                int fontSize,
                                int x,
                                int y,
                                java.lang.String text,
                                java.awt.Color color)
                         throws java.io.IOException
        Specified by:
        writeString in interface IPdfDrawer
        Throws:
        java.io.IOException
      • writeLabel

        public void writeLabel​(org.apache.pdfbox.pdmodel.font.PDType0Font font,
                               int fontSize,
                               int x,
                               int y,
                               java.lang.String text,
                               java.awt.Color color)
                        throws java.io.IOException
        Specified by:
        writeLabel in interface IPdfDrawer
        Throws:
        java.io.IOException
      • checkBooleanValue

        protected boolean checkBooleanValue​(java.util.List<java.lang.String> values,
                                            java.lang.String text)
      • drawSvg

        protected void drawSvg​(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject resourceObject,
                               int x,
                               int y)
                        throws java.io.IOException
        Throws:
        java.io.IOException