org.zefer.pd4ml
Class PD4Document

java.lang.Object
  extended by org.zefer.pd4ml.npdf.PD4DocumentBase
      extended by org.zefer.pd4ml.PD4Document

public class PD4Document
extends PD4DocumentBase


Field Summary
 
Fields inherited from class org.zefer.pd4ml.npdf.PD4DocumentBase
bytes, debug, newDocument, overlay, overlayDestScope, overlayOpacity, overlaySrcScope, password, pdf, reassignedToAnotherDocument, stream, toMerge, underlayFlag, url
 
Constructor Summary
PD4Document(byte[] bytes, java.lang.String password)
           
PD4Document(java.io.InputStream stream, java.lang.String password)
           
PD4Document(java.net.URL url, java.lang.String password)
           
 
Method Summary
static void mergePDFs(java.io.InputStream pdf1, java.io.InputStream pdf2, java.io.OutputStream result)
          basic PDF merging method.
protected  void read(int objectCounter)
          reads and parses given PDF document stream
 
Methods inherited from class org.zefer.pd4ml.npdf.PD4DocumentBase
append, computeScope, deletePage, dumpOutlines, getAuthor, getCreationDate, getCreator, getKeywords, getModDate, getNumberOfPages, getObjectCounter, getPageContent, getPdfFormatVersion, getPermissions, getProducer, getSubject, getTitle, overlay, overlay, read, readIfNeeded, setAuthor, setCreator, setKeywords, setModDate, setSubject, setTitle, underlay, underlay, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PD4Document

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

PD4Document

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

PD4Document

public PD4Document(java.net.URL url,
                   java.lang.String password)
            throws PD4InvokeException
Parameters:
url - PDF document URL
password - if any. "null" for not protected PDF documents
Throws:
PD4InvokeException - 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

read

protected void read(int objectCounter)
             throws java.io.IOException,
                    PD4InvalidPasswordException
reads and parses given PDF document stream

Specified by:
read in class PD4DocumentBase
Parameters:
objectCounter - initial object number to re-index PDF objects. Used by PDF merge scenarios
Throws:
java.io.IOException - read/parsing errors
PD4InvalidPasswordException


Copyright © 2004-15 zefer.org. All Rights Reserved.