Interface PdfBoxOutputDevice

    • Method Detail

      • setWriter

        void setWriter​(org.apache.pdfbox.pdmodel.PDDocument writer)
      • getWriter

        org.apache.pdfbox.pdmodel.PDDocument getWriter()
      • initializePage

        void initializePage​(org.apache.pdfbox.pdmodel.PDPageContentStream currentPage,
                            org.apache.pdfbox.pdmodel.PDPage page,
                            float height)
        Start a page. A new PDF page starts a new content stream so all graphics state has to be set back to default.
      • finishPage

        void finishPage()
      • getDeviceLength

        float getDeviceLength​(float length)
        Given a value in dots units, converts to PDF points.
      • drawBorderLine

        void drawBorderLine​(java.awt.Shape bounds,
                            int side,
                            int lineWidth,
                            boolean solid)
        Specified by:
        drawBorderLine in interface OutputDevice
      • draw

        void draw​(java.awt.Shape s)
        Specified by:
        draw in interface OutputDevice
      • drawRect

        void drawRect​(int x,
                      int y,
                      int width,
                      int height)
        Specified by:
        drawRect in interface OutputDevice
      • drawOval

        void drawOval​(int x,
                      int y,
                      int width,
                      int height)
        Specified by:
        drawOval in interface OutputDevice
      • fill

        void fill​(java.awt.Shape s)
        Specified by:
        fill in interface OutputDevice
      • fillRect

        void fillRect​(int x,
                      int y,
                      int width,
                      int height)
        Specified by:
        fillRect in interface OutputDevice
      • fillOval

        void fillOval​(int x,
                      int y,
                      int width,
                      int height)
        Specified by:
        fillOval in interface OutputDevice
      • translate

        void translate​(double tx,
                       double ty)
        Specified by:
        translate in interface OutputDevice
      • getRenderingHint

        java.lang.Object getRenderingHint​(java.awt.RenderingHints.Key key)
        Specified by:
        getRenderingHint in interface OutputDevice
      • setRenderingHint

        void setRenderingHint​(java.awt.RenderingHints.Key key,
                              java.lang.Object value)
        Specified by:
        setRenderingHint in interface OutputDevice
      • drawString

        void drawString​(java.lang.String s,
                        float x,
                        float y,
                        JustificationInfo info)
      • getPage

        org.apache.pdfbox.pdmodel.PDPage getPage()
      • normalizeY

        float normalizeY​(float y,
                         float pageHeight)
        Converts a top down unit to a bottom up PDF unit for the specified page height.
      • clip

        void clip​(java.awt.Shape s)
        Specified by:
        clip in interface OutputDevice
      • setClip

        void setClip​(java.awt.Shape s)
        Specified by:
        setClip in interface OutputDevice
      • getDotsPerPoint

        float getDotsPerPoint()
      • start

        void start​(org.w3c.dom.Document doc)
      • addMetadata

        void addMetadata​(java.lang.String name,
                         java.lang.String value)
        Appends a name/content metadata pair to this output device. A name or content value of null will be ignored.
        Parameters:
        name - the name of the metadata element to add.
      • getMetadataByName

        java.lang.String getMetadataByName​(java.lang.String name)
        Searches the metadata name/content pairs of the current document and returns the content value from the first pair with a matching name. The search is case insensitive.
        Parameters:
        name - the metadata element name to locate.
        Returns:
        the content value of the first found metadata element; otherwise null.
      • getMetadataListByName

        java.util.List<java.lang.String> getMetadataListByName​(java.lang.String name)
        Searches the metadata name/content pairs of the current document and returns any content values with a matching name in an ArrayList. The search is case insensitive.
        Parameters:
        name - the metadata element name to locate.
        Returns:
        an ArrayList with matching content values; otherwise an empty list.
      • setMetadata

        void setMetadata​(java.lang.String name,
                         java.lang.String value)
        Replaces all copies of the named metadata with a single value. A a new value of null will result in the removal of all copies of the named metadata. Use addMetadata to append additional values with the same name.
        Parameters:
        name - the metadata element name to locate.
      • setSharedContext

        void setSharedContext​(SharedContext sharedContext)
      • setRoot

        void setRoot​(Box root)
      • getStartPageNo

        int getStartPageNo()
      • setStartPageNo

        void setStartPageNo​(int startPageNo)
      • findPagePositionsByID

        java.util.List<PagePosition<Box>> findPagePositionsByID​(CssContext c,
                                                                java.util.regex.Pattern pattern)
      • setBidiReorderer

        void setBidiReorderer​(BidiReorderer reorderer)
      • popTransforms

        void popTransforms​(java.util.List<java.awt.geom.AffineTransform> inverse)
        Specified by:
        popTransforms in interface OutputDevice
      • pushTransforms

        java.util.List<java.awt.geom.AffineTransform> pushTransforms​(java.util.List<java.awt.geom.AffineTransform> transforms)
        Description copied from interface: OutputDevice
        Apply the given transform on top of the current one in the PDF graphics stream. This is a cumulative operation. You should popTransform after the box and children are painted.
        Specified by:
        pushTransforms in interface OutputDevice
        Returns:
        the list of inverse transforms to undo the effect of this transform
      • setPaint

        void setPaint​(java.awt.Paint paint)
        Specified by:
        setPaint in interface OutputDevice
      • close

        void close()
        Perform any internal cleanup needed
      • getPageRefY

        int getPageRefY​(Box box)
      • drawPdfAsImage

        void drawPdfAsImage​(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _src,
                            java.awt.Rectangle contentBounds,
                            float intrinsicWidth,
                            float intrinsicHeight)