|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zefer.pd4ml.PD4Document
public class PD4Document
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 | |
---|---|
void |
append(PD4Document toMerge)
|
java.lang.String |
getAuthor()
|
java.lang.String |
getCreationDate()
|
java.lang.String |
getCreator()
|
java.lang.String |
getKeywords()
|
java.lang.String |
getModDate()
|
int |
getNumberOfPages()
|
java.lang.String |
getPdfFormatVersion()
|
int |
getPermissions()
|
java.lang.String |
getProducer()
|
java.lang.String |
getSubject()
|
java.lang.String |
getTitle()
|
static void |
mergePDFs(java.io.InputStream pdf1,
java.io.InputStream pdf2,
java.io.OutputStream result)
basic PDF mergeing method. |
void |
read()
reads and parses given PDF document stream |
void |
setAuthor(java.lang.String author)
|
void |
setCreator(java.lang.String creator)
|
void |
setKeywords(java.lang.String keywords)
|
void |
setModDate()
sets the document modification date to "now" |
void |
setSubject(java.lang.String subject)
|
void |
setTitle(java.lang.String title)
|
void |
write(java.io.OutputStream out)
writes current PDF document state to given output stream. |
void |
write(java.io.OutputStream out,
java.lang.String password,
int permissions)
writes current PDF document state to given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PD4Document(byte[] bytes, java.lang.String password) throws PD4InvokeException
bytes
- PDF document as an array of bytespassword
- if any. "null" for not protected PDF documents
PD4InvokeException
- by invalid call parameterspublic PD4Document(java.io.InputStream stream, java.lang.String password) throws PD4InvokeException
stream
- PDF document input streampassword
- if any. "null" for not protected PDF documents
PD4InvokeException
- by invalid call parameterspublic PD4Document(java.net.URL url, java.lang.String password) throws PD4InvokeException
url
- PDF document URLpassword
- if any. "null" for not protected PDF documents
PD4InvokeException
- by invalid call parametersMethod Detail |
---|
public void write(java.io.OutputStream out) throws java.io.IOException
out
- an output stream to write to
java.io.IOException
- write errorspublic void write(java.io.OutputStream out, java.lang.String password, int permissions) throws java.io.IOException, PD4InvalidPasswordException
out
- an output stream to write topassword
- password string. null if no password to be appliedpermissions
- PDF file access permissions See PD4Constants.Allow* constants.
Example AllowAnnotate | AllowDegradedPrint. Use PD4Constants.DefaultPermissions
for defaults.
java.io.IOException
- write errors
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void append(PD4Document toMerge) throws java.io.IOException
toMerge
- another PDF document to append to the current one. Implicitly invokes read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public static void mergePDFs(java.io.InputStream pdf1, java.io.InputStream pdf2, java.io.OutputStream result) throws java.io.IOException
pdf1
- main PDF document bytes streampdf2
- PDF document bytes to appendresult
- output stream to write resulting PDF
java.io.IOException
- reflects a variety of PDF read/parse/write errorspublic int getNumberOfPages() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public int getPermissions() throws java.io.IOException, PD4InvalidPasswordException
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getTitle() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void setTitle(java.lang.String title) throws java.io.IOException, PD4InvalidPasswordException
title
- new document title. Implicitly invokes read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getAuthor() throws java.io.IOException, PD4InvalidPasswordException
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void setAuthor(java.lang.String author) throws java.io.IOException
author
- a value to override document "Author" name. Implicitly invokes read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getPdfFormatVersion() throws java.io.IOException, PD4InvalidPasswordException
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getCreationDate() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getKeywords() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void setKeywords(java.lang.String keywords) throws java.io.IOException, PD4InvalidPasswordException
keywords
- a value to override document "Keywords" string. Implicitly invokes read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getCreator() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void setCreator(java.lang.String creator) throws java.io.IOException, PD4InvalidPasswordException
creator
- a value to override document "Creator" name. Implicitly invokes read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getProducer() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getSubject() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void setSubject(java.lang.String subject) throws java.io.IOException, PD4InvalidPasswordException
subject
- a value to override document "Subject" string. Implicitly invokes read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void setModDate() throws java.io.IOException, PD4InvalidPasswordException
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public java.lang.String getModDate() throws java.io.IOException, PD4InvalidPasswordException
read()
if has not been triggered before.
java.io.IOException
- reflects a variety of PDF read/parse errors by read()
PD4InvalidPasswordException
- invalid password given to the object constructor, i.e. PD4Document(byte[], String)
.public void read() throws java.io.IOException, PD4InvokeException, PD4InvalidPasswordException
java.io.IOException
- read/parsing errors
PD4InvokeException
- PDF parsing specific errors
PD4InvalidPasswordException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |