|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.PdfCopyFields
public class PdfCopyFields
Concatenates PDF documents including form fields. The rules for the form field concatenation are the same as in Acrobat. All the documents are kept in memory unlike PdfCopy.
Constructor Summary | |
---|---|
PdfCopyFields(OutputStream os)
Creates a new instance. |
|
PdfCopyFields(OutputStream os,
char pdfVersion)
Creates a new instance. |
Method Summary | |
---|---|
void |
addDocument(PdfReader reader)
Concatenates a PDF document. |
void |
addDocument(PdfReader reader,
List pagesToKeep)
Concatenates a PDF document selecting the pages to keep. |
void |
addDocument(PdfReader reader,
String ranges)
Concatenates a PDF document selecting the pages to keep. |
void |
addJavaScript(String js)
Adds JavaScript to the global document |
void |
close()
Closes the output document. |
PdfWriter |
getWriter()
Gets the underlying PdfWriter. |
boolean |
isFullCompression()
Gets the 1.5 compression status. |
void |
open()
Opens the document. |
void |
setEncryption(boolean strength,
String userPassword,
String ownerPassword,
int permissions)
Sets the encryption options for this document. |
void |
setEncryption(byte[] userPassword,
byte[] ownerPassword,
int permissions,
boolean strength128Bits)
Sets the encryption options for this document. |
void |
setFullCompression()
Sets the document's compression to the new 1.5 mode with object streams and xref streams. |
void |
setOutlines(List outlines)
Sets the bookmarks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PdfCopyFields(OutputStream os) throws DocumentException, IOException
os
- the output stream
DocumentException
- on error
IOException
- on errorpublic PdfCopyFields(OutputStream os, char pdfVersion) throws DocumentException, IOException
os
- the output streampdfVersion
- the pdf version the output will have
DocumentException
- on error
IOException
- on errorMethod Detail |
---|
public void addDocument(PdfReader reader) throws DocumentException
reader
- the PDF document
DocumentException
- on errorpublic void addDocument(PdfReader reader, List pagesToKeep) throws DocumentException
List
of Integer
. The page ordering can be changed but
no page repetitions are allowed.
reader
- the PDF documentpagesToKeep
- the pages to keep
DocumentException
- on errorpublic void addDocument(PdfReader reader, String ranges) throws DocumentException
reader
- the PDF documentranges
- the comma separated ranges as described in SequenceList
DocumentException
- on errorpublic void setEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, boolean strength128Bits) throws DocumentException
userPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissionsstrength128Bits
- true
for 128 bit key length, false
for 40 bit key length
DocumentException
- if the document is already openpublic void setEncryption(boolean strength, String userPassword, String ownerPassword, int permissions) throws DocumentException
strength
- true for 128 bit key length. false for 40 bit key lengthuserPassword
- the user password. Can be null or emptyownerPassword
- the owner password. Can be null or emptypermissions
- the user permissions
DocumentException
- if the document is already openpublic void close()
public void open()
public void addJavaScript(String js)
js
- the JavaScriptpublic void setOutlines(List outlines)
SimpleBookmark#
.
outlines
- the bookmarks or null
to remove anypublic PdfWriter getWriter()
public boolean isFullCompression()
true
if the 1.5 compression is onpublic void setFullCompression()
If set before opening the document it will also set the pdf version to 1.5.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |