Package org.zefer.pd4ml
Class PD4Document
java.lang.Object
org.zefer.pd4ml.npdf.PD4DocumentBase
org.zefer.pd4ml.PD4Document
-
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
ConstructorsConstructorDescriptionPD4Document
(byte[] bytes, String password) PD4Document
(InputStream stream, String password) PD4Document
(URL url, String password) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
mergePDFs
(InputStream pdf1, InputStream pdf2, OutputStream result) basic PDF merging method.protected void
read
(int objectCounter) reads and parses given PDF document streamMethods 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
-
Constructor Details
-
PD4Document
- Parameters:
bytes
- PDF document as an array of bytespassword
- if any. "null" for not protected PDF documents- Throws:
PD4InvokeException
- by invalid call parameters
-
PD4Document
- Parameters:
stream
- PDF document input streampassword
- if any. "null" for not protected PDF documents- Throws:
PD4InvokeException
- by invalid call parameters
-
PD4Document
- Parameters:
url
- PDF document URLpassword
- if any. "null" for not protected PDF documents- Throws:
PD4InvokeException
- by invalid call parameters
-
-
Method Details
-
mergePDFs
public static void mergePDFs(InputStream pdf1, InputStream pdf2, OutputStream result) throws IOException basic PDF merging method. Appends pdf2 to pdf1 bytes and writes resulting PDF to result.- Parameters:
pdf1
- main PDF document bytes streampdf2
- PDF document bytes to appendresult
- output stream to write resulting PDF- Throws:
IOException
- reflects a variety of PDF read/parse/write errors
-
read
reads and parses given PDF document stream- Specified by:
read
in classPD4DocumentBase
- Parameters:
objectCounter
- initial object number to re-index PDF objects. Used by PDF merge scenarios- Throws:
IOException
- read/parsing errorsPD4InvalidPasswordException
-