Class PdfCopyForms
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
Allows you to add one (or more) existing PDF document(s) to create a new PDF and add the form of another PDF document to this new PDF. @since 2.1.5
public class PdfCopyForms : IPdfViewerPreferences, IPdfEncryptionSettings
- Inheritance
-
PdfCopyForms
- Implements
- Inherited Members
Constructors
PdfCopyForms(Stream)
Creates a new instance. @throws DocumentException on error
public PdfCopyForms(Stream os)
Parameters
os
Streamthe output stream
Properties
FullCompression
Gets the 1.5 compression status.
public bool FullCompression { get; }
Property Value
- bool
true if the 1.5 compression is on
Outlines
Sets the bookmarks. The list structure is defined in SimpleBookmark# .
public IList<INullValueDictionary<string, object>> Outlines { set; }
Property Value
ViewerPreferences
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#setViewerPreferences(int)
public int ViewerPreferences { set; }
Property Value
Writer
Gets the underlying PdfWriter.
public PdfWriter Writer { get; }
Property Value
- PdfWriter
the underlying PdfWriter
Methods
AddDocument(PdfReader)
Concatenates a PDF document. @throws DocumentException on error
public void AddDocument(PdfReader reader)
Parameters
reader
PdfReaderthe PDF document
AddDocument(PdfReader, ICollection<int>)
Concatenates a PDF document selecting the pages to keep. The pages are described as a List of Integer . The page ordering can be changed but no page repetitions are allowed. @throws DocumentException on error
public void AddDocument(PdfReader reader, ICollection<int> pagesToKeep)
Parameters
reader
PdfReaderthe PDF document
pagesToKeep
ICollection<int>the pages to keep
AddDocument(PdfReader, string)
Concatenates a PDF document selecting the pages to keep. The pages are described as ranges. The page ordering can be changed but no page repetitions are allowed. @throws DocumentException on error
public void AddDocument(PdfReader reader, string ranges)
Parameters
reader
PdfReaderthe PDF document
ranges
stringthe comma separated ranges as described in {@link SequenceList}
AddJavaScript(string)
Adds JavaScript to the global document
public void AddJavaScript(string js)
Parameters
js
stringthe JavaScript
AddViewerPreference(PdfName, PdfObject)
@see com.lowagie.text.pdf.interfaces.PdfViewerPreferences#addViewerPreference(com.lowagie.text.pdf.PdfName, com.lowagie.text.pdf.PdfObject)
public void AddViewerPreference(PdfName key, PdfObject value)
Parameters
Close()
Closes the output document.
public void Close()
CopyDocumentFields(PdfReader)
Copies the form fields of this PDFDocument onto the PDF-Document which was added @throws DocumentException on error
public void CopyDocumentFields(PdfReader reader)
Parameters
reader
PdfReaderthe PDF document
Open()
Opens the document. This is usually not needed as addDocument() will do it automatically.
public void Open()
SetEncryption(X509Certificate[], int[], int)
@see com.lowagie.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(java.security.cert.Certificate[], int[], int)
public void SetEncryption(X509Certificate[] certs, int[] permissions, int encryptionType)
Parameters
SetEncryption(bool, string, string, int)
Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them. @throws DocumentException if the document is already open
public void SetEncryption(bool strength, string userPassword, string ownerPassword, int permissions)
Parameters
strength
booltrue for 128 bit key length. false for 40 bit key length
userPassword
stringthe user password. Can be null or empty
ownerPassword
stringthe owner password. Can be null or empty
permissions
intthe user permissions
SetEncryption(byte[], byte[], int, bool)
Sets the encryption options for this document. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them. @throws DocumentException if the document is already open
public void SetEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, bool strength128Bits)
Parameters
userPassword
byte[]the user password. Can be null or empty
ownerPassword
byte[]the owner password. Can be null or empty
permissions
intthe user permissions
strength128Bits
booltrue for 128 bit key length, false for 40 bit key length
SetEncryption(byte[], byte[], int, int)
@see com.lowagie.text.pdf.interfaces.PdfEncryptionSettings#setEncryption(byte[], byte[], int, int)
public void SetEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionType)
Parameters
SetFullCompression()
Sets the document's compression to the new 1.5 mode with object streams and xref streams. It can be set at any time but once set it can't be unset. If set before opening the document it will also set the pdf version to 1.5.
public void SetFullCompression()