Class PdfSmartCopy

    • Method Detail

      • copyIndirect

        protected PdfIndirectReference copyIndirect​(PRIndirectReference in)
                                             throws java.io.IOException,
                                                    BadPdfFormatException
        Translate a PRIndirectReference to a PdfIndirectReference In addition, translates the object numbers, and copies the referenced object to the output file if it wasn't available in the cache yet. If it's in the cache, the reference to the already used stream is returned. NB: PRIndirectReferences (and PRIndirectObjects) really need to know what file they came from, because each file has its own namespace. The translation we do from their namespace to ours is *at best* heuristic, and guaranteed to fail under some circumstances.
        Overrides:
        copyIndirect in class PdfCopy
        Throws:
        java.io.IOException
        BadPdfFormatException
      • freeReader

        public void freeReader​(PdfReader reader)
                        throws java.io.IOException
        Description copied from class: PdfWriter
        Use this method to writes the reader to the document and free the memory used by it. The main use is when concatenating multiple documents to keep the memory usage restricted to the current appending document.
        Overrides:
        freeReader in class PdfCopy
        Parameters:
        reader - the PdfReader to free
        Throws:
        java.io.IOException - on error