Package com.pd4ml

Class PdfDocument

    • Constructor Detail

      • PdfDocument

        public PdfDocument​(byte[] bytes,
                           java.lang.String password)
                    throws InvokeException
        Parameters:
        bytes - PDF document as an array of bytes
        password - if any. "null" for not protected PDF documents
        Throws:
        InvokeException - by invalid call parameters
      • PdfDocument

        public PdfDocument​(java.io.InputStream stream,
                           java.lang.String password)
                    throws InvokeException
        Parameters:
        stream - PDF document input stream
        password - if any. "null" for not protected PDF documents
        Throws:
        InvokeException - by invalid call parameters
      • PdfDocument

        public PdfDocument​(java.net.URL url,
                           java.lang.String password)
                    throws InvokeException
        Parameters:
        url - PDF document URL
        password - if any. "null" for not protected PDF documents
        Throws:
        InvokeException - by invalid call parameters
      • PdfDocument

        public PdfDocument​(com.pd4ml.pdf.parser.PdfDoc writer)
                    throws InvokeException
        Parameters:
        writer - PDF document PdfWriter object
        Throws:
        InvokeException - by invalid call parameters
    • Method Detail

      • mergePDFs

        public static void mergePDFs​(java.io.InputStream pdf1,
                                     java.io.InputStream pdf2,
                                     java.io.OutputStream result)
                              throws java.io.IOException
        basic PDF merging method. Appends pdf2 to pdf1 bytes and writes resulting PDF to result.
        Parameters:
        pdf1 - main PDF document bytes stream
        pdf2 - PDF document bytes to append
        result - output stream to write resulting PDF
        Throws:
        java.io.IOException - reflects a variety of PDF read/parse/write errors