Class PdfACopy

    • Field Detail

      • COUNTER

        protected Counter COUNTER
    • Method Detail

      • getPdfAChecker

        private PdfAChecker getPdfAChecker()
      • createPageStamp

        public PdfCopy.PageStamp createPageStamp​(PdfImportedPage iPage)
        Description copied from class: PdfCopy
        Create a page stamp. New content and annotations, including new fields, are allowed. The fields added cannot have parents in another pages. This method modifies the PdfReader instance.

        The general usage to stamp something in a page is:

         PdfImportedPage page = copy.getImportedPage(reader, 1);
         PdfCopy.PageStamp ps = copy.createPageStamp(page);
         ps.addAnnotation(PdfAnnotation.createText(copy, new Rectangle(50, 180, 70, 200), "Hello", "No Thanks", true, "Comment"));
         PdfContentByte under = ps.getUnderContent();
         under.addImage(img);
         PdfContentByte over = ps.getOverContent();
         over.beginText();
         over.setFontAndSize(bf, 18);
         over.setTextMatrix(30, 30);
         over.showText("total page " + totalPage);
         over.endText();
         ps.alterContents();
         copy.addPage(page);
         
        Overrides:
        createPageStamp in class PdfCopy
        Parameters:
        iPage - an imported page
        Returns:
        the PageStamp
      • setOutputIntents

        public void setOutputIntents​(java.lang.String outputConditionIdentifier,
                                     java.lang.String outputCondition,
                                     java.lang.String registryName,
                                     java.lang.String info,
                                     ICC_Profile colorProfile)
                              throws java.io.IOException
        Description copied from class: PdfWriter
        Sets the values of the output intent dictionary. Null values are allowed to suppress any key.
        Overrides:
        setOutputIntents in class PdfWriter
        Parameters:
        outputConditionIdentifier - a value
        outputCondition - a value
        registryName - a value
        info - a value
        colorProfile - a value
        Throws:
        java.io.IOException - on error
      • setOutputIntents

        public boolean setOutputIntents​(PdfReader reader,
                                        boolean checkExistence)
                                 throws java.io.IOException
        Copies the output intent dictionary from other document to this one.
        Overrides:
        setOutputIntents in class PdfWriter
        Parameters:
        reader - the other document
        checkExistence - true to just check for the existence of a valid output intent dictionary, false to insert the dictionary if it exists
        Returns:
        true if the output intent dictionary exists, false otherwise
        Throws:
        java.io.IOException - on error
      • createXmpWriter

        protected XmpWriter createXmpWriter​(java.io.ByteArrayOutputStream baos,
                                            java.util.HashMap<java.lang.String,​java.lang.String> info)
                                     throws java.io.IOException
        Overrides:
        createXmpWriter in class PdfWriter
        Throws:
        java.io.IOException
      • close

        public void close()
        Description copied from class: PdfCopy
        Signals that the Document was closed and that no other Elements will be added.

        The pages-tree is built and written to the outputstream. A Catalog is constructed, as well as an Info-object, the reference table is composed and everything is written to the outputstream embedded in a Trailer.

        Specified by:
        close in interface DocListener
        Overrides:
        close in class PdfCopy
        See Also:
        DocWriter.close()
      • checkPdfAInfo

        private void checkPdfAInfo​(PdfReader reader)