PDFFixedDocument¶
Namespace: O2S.Components.PDF4NET
Defines a PDF document.
Inheritance Object → PDFDocument → PDFFixedDocument
Constructors¶
PDFFixedDocument()¶
Initializes a new PDFDocument object.
PDFFixedDocument(String)¶
Initializes a new PDFFixedDocument object.
Parameters
fileName String
A string that contains the name of the file from which to create the document.
PDFFixedDocument(String, PDFDocumentFeatures)¶
Initializes a new PDFFixedDocument object.
Parameters
fileName String
A string that contains the name of the file from which to create the document.
documentFeatures PDFDocumentFeatures
Features to load from the PDF file.
PDFFixedDocument(String, String)¶
Initializes a new PDFFixedDocument object.
Parameters
fileName String
A string that contains the name of the file from which to create the document.
password String
Password required to open the PDF file.
PDFFixedDocument(String, String, PDFDocumentFeatures)¶
Initializes a new PDFFixedDocument object.
Parameters
fileName String
A string that contains the name of the file from which to create the document.
password String
Password required to open the PDF file.
documentFeatures PDFDocumentFeatures
Features to load from the PDF file.
PDFFixedDocument(Stream)¶
Initializes a new PDFDocument object from a PDF stream.
Parameters
stream Stream
Stream that contains PDF content.
PDFFixedDocument(Stream, PDFDocumentFeatures)¶
Initializes a new PDFDocument object from a PDF stream with the specified features.
Parameters
stream Stream
Stream that contains PDF content.
documentFeatures PDFDocumentFeatures
Features to load from the PDF file.
PDFFixedDocument(Stream, String)¶
Initializes a new PDFDocument object from a PDF stream.
Parameters
stream Stream
Stream that contains PDF content.
password String
Password required to open the PDF file.
PDFFixedDocument(Stream, String, PDFDocumentFeatures)¶
Initializes a new PDFDocument object from a PDF stream with the specified features.
Parameters
stream Stream
Stream that contains PDF content.
password String
Password required to open the PDF file.
documentFeatures PDFDocumentFeatures
Features to load from the PDF file.
Properties¶
AfterPrintAction¶
Gets or sets the javascript action to execute after the document is printed.
Property Value
PDFJavaScriptAction
A PDFJavaScriptAction object
specifying the action to be executed after the document is printed.
AfterSaveAction¶
Gets or sets the javascript action to execute after the document is saved.
Property Value
PDFJavaScriptAction
A PDFJavaScriptAction object
specifying the action to be executed after the document is saved.
BeforeCloseAction¶
Gets or sets the javascript action to execute before the document is closed.
Property Value
PDFJavaScriptAction
A PDFJavaScriptAction object
specifying the action to be executed before the document is closed.
BeforePrintAction¶
Gets or sets the javascript action to execute before the document is printed.
Property Value
PDFJavaScriptAction
A PDFJavaScriptAction object
specifying the action to be executed before the document is printed.
BeforeSaveAction¶
Gets or sets the javascript action to execute before the document is saved.
Property Value
PDFJavaScriptAction
A PDFJavaScriptAction object
specifying the action to be executed before the document is saved.
CosDictionary¶
Gets the COS dictionary asssociated with this object.
Property Value
PDFCosDictionary
The internal COS dictionary.
Remarks
Incorrect manipulation of the information in the COS dictionary can lead to invalid PDF files.
DisplayMode¶
Gets or sets how the document should be displayed when opened in the viewer.
Property Value
PDFDisplayMode
A PDFDisplayMode enumeration member specifying how the viewer should display the document.
DocumentInformation¶
Gets or sets the document information.
Property Value
PDFDocumentInformation
The document's metadata.
DocumentSecurityStore¶
Gets or sets the document security store.
Property Value
PDFDocumentSecurityStore
A PDFDocumentSecurityStore object.
Remarks
The document security store includes relevant information for validating digital signatures.
It supports the ability to add this critical information after the signed document has been created and before this information is no longer available.
FileAttachments¶
Gets the list of file attachments embedded in this document.
Property Value
PDFDocumentFileAttachmentCollection
PDFDocumentFileAttachmentCollection object specifying the list
of document attachments.
Remarks
When a PDF file is imported into a PDFDocument object, this collection is populated automatically with the attachments in the file.
Form¶
Gets the PDF form included in the document.
Property Value
PDFForm
A PDFForm object representing the PDF form included in the document.
ID¶
Gets or sets the document ID.
Property Value
Byte[]
The PDF identifier of this document.
JavaScriptBlocks¶
Gets the JavaScript source code blocks.
Property Value
PDFJavaScriptBlockCollection
The collection of JavaScript source code block that are embedded in the document.
Language¶
Gets or sets the document language.
Property Value
String
A language identifier that shall specify the natural language for all text in the document except where overridden by language specifications for structure elements or marked content.
MarkInformation¶
Gets or sets the document mark information.
Property Value
PDFMarkInformation
A PDFMarkInformation object specifying whether the document conforms to Tagged PDF specification.
NamedDestinations¶
Gets the list of named destination included in the document.
Property Value
PDFNamedDestinationCollection
The list of named destinations included in the document.
OpenAction¶
Gets or sets the action to execute when the document is opened.
Property Value
PDFAction
A PDFAction object specifying the action
to be executed when documents opens in the viewer.
OptionalContentProperties¶
Gets the optional content properties for this document.
Property Value
PDFOptionalContentProperties
The properties related to optional content included in the document.
Outline¶
Gets the document outline.
Property Value
PDFOutlineItemCollection
A tree-structured hierarchy of outline items.
OutputIntents¶
Gets or sets the collection of output intents.
Property Value
PDFOutputIntentCollection
A collection of PDFOutputIntent objects describing the color
characteristics of output devices on which the document might be rendered.
PageLabelingRanges¶
Gets the list of page labeling ranges in the PDF document.
Property Value
PDFPageLabelingRangeCollection
The list of page labeling ranges in the document.
PageLayout¶
Gets or sets the document's page layout specifying how the pages should be displayed when opened.
Property Value
PDFPageLayout
The document's page layout.
Pages¶
Gets the list of pages in the document;
Property Value
PDFPageCollection
The document's pages.
PDFVersion¶
Gets or sets the PDF version of this PDFDocument object.
Property Value
PDFVersion
A PDFFixedDocument.PDFVersion enumeration member specifying the PDF version
of this PDFDocument object.
SecurityHandler¶
Gets the document security handler.
Property Value
PDFSecurityHandler
A PDFSecurityHandler that represents the handler used to encrypt the file loaded in this PDFDocument.
Remarks
Both RC4 and AES security handlers are supported.
StructureTree¶
Gets or sets the document structure tree.
Property Value
PDFStructureTree
The root of the document structure tree.
VersionExtension¶
Gets or sets the version extension.
Property Value
PDFVersionExtension
The extended PDF version this document implements.
ViewerPreferences¶
Gets or sets the document's viewer preferences.
Property Value
PDFViewerPreferences
The viewer preferences for displaying the document.
XmpMetadata¶
Gets or sets the XMP document metadata.
Property Value
PDFXmpMetadata
The XMP document metadata.
Methods¶
AppendFile(String)¶
Appends a PDF file at the end of the document.
Parameters
fileName String
Path to PDF file to append.
AppendFile(Stream)¶
Appends a PDF file at the end of the document.
Parameters
stream Stream
Stream with the file to append.
BeginSave(Stream)¶
Initializes a save procedure for the PDF file.
Parameters
stream Stream
Destination stream where the PDF file will be saved.
BeginSave(Stream, PDFSecurityHandler)¶
Initializes a save procedure for the PDF file.
Parameters
stream Stream
Destination stream where the PDF file will be saved.
securityHandler PDFSecurityHandler
Security handler for encrypting the saved file.
BeginSave(Stream, PDFStandardFormatter)¶
Initializes a save procedure for the PDF file.
Parameters
stream Stream
Destination stream where the PDF file will be saved.
standardFormatter PDFStandardFormatter
Formatter for saving the PDF file according to a specific PDF standard.
CertifyDocument(PDFSignatureField, PDFDigitalSignatureAllowedChanges)¶
Certifies the document with the given signature.
public void CertifyDocument(PDFSignatureField signatureField, PDFDigitalSignatureAllowedChanges allowedChanges)
Parameters
signatureField PDFSignatureField
The field that stores the certifying signature.
allowedChanges PDFDigitalSignatureAllowedChanges
The changes allowed by the signature.
Remarks
This method transforms the signature in the field from an approval signature into a certifying (author) signature. This method should be called only once as a PDF document supports only one certifying signature.
EndSave()¶
Finishes the save procedure initiated by PDFFixedDocument.BeginSave(Stream) method.
GetCosObjectByNumber(UInt32, Boolean)¶
Gets the specified COS object.
Parameters
objectNumber UInt32
The object number of the specified COS object.
loadStreamContent Boolean
If true then the stream content is also loaded when the object number specifies a stream object.
Otherwise only the dictionary part of the stream is loaded.
Returns
PDFCosObject
The COS object if exists, null otherwise.
Remarks
This method should be used with PDFFixedDocument objects created from existing PDF files. For newly created document this method returns null.
GetCosObjectCount()¶
Gets the total number of COS objects in the document.
Returns
Int32
The total number of COS objects in the document.
Remarks
This method should be used with PDFFixedDocument objects created from existing PDF files. For newly created documents this method returns 0.
GetDocumentFonts(Boolean, Boolean)¶
Gets the set of fonts included in the document.
public HashSet<PDFCosDictionary> GetDocumentFonts(bool includeEmbeddedFont, bool includeNonEmbeddedFonts)
Parameters
includeEmbeddedFont Boolean
True if the set should include the embedded fonts.
includeNonEmbeddedFonts Boolean
True if the set should include the non-embedded fonts.
Returns
HashSet<PDFCosDictionary>
A set of PDFCosDictionary objects representing the fonts used by this document.
InsertFile(Int32, Int32, String)¶
Inserts a PDF file in the document.
Parameters
pageIndex Int32
Position in the PDFFixedDocument.Pages collection where the pages from the file are inserted.
outlineIndex Int32
Position in the PDFFixedDocument.Outline collection where the outlines from the file are inserted.
fileName String
Path to PDF file to append.
InsertFile(Int32, Int32, Stream)¶
Inserts a PDF file in the document.
Parameters
pageIndex Int32
Position in the PDFFixedDocument.Pages collection where the pages from the file are inserted.
outlineIndex Int32
Position in the PDFFixedDocument.Outline collection where the outlines from the file are inserted.
stream Stream
Stream with the file to insert.
Save(String, PDFSecurityHandler, Boolean)¶
Saves the document to the specified file.
Parameters
fileName String
A string that contains the name of the file where the document is saved.
securityHandler PDFSecurityHandler
Security handler for encrypting the saved file.
enableObjectCompression Boolean
When set to true, the structure of the PDF objects is also compressed. Supported when PDF version >= 1.5
Save(Stream, PDFSecurityHandler, Boolean)¶
Saves the PDF document to the specified stream.
Parameters
stream Stream
Destination stream.
securityHandler PDFSecurityHandler
Security handler for encrypting the saved file.
enableObjectCompression Boolean
When set to true, the structure of the PDF objects is also compressed. Supported when PDF version >= 1.5