PDFDocument¶
Namespace: O2S.Components.PDF4NET
Defines an abstract PDF document.
Inheritance Object → PDFDocument
Properties¶
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.
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.
ID¶
Gets or sets the document ID.
Property Value
Byte[]
The PDF identifier of this 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.
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.
Methods¶
Load(String)¶
Loads a PDF file and returns either a fixed document or a portfolio depending on the PDF file type.
Parameters
fileName String
Path to source PDF file
Returns
PDFDocument
A PDFFixedDocument object or a PDFPortfolio object depending on the PDF file type.
Load(String, String)¶
Loads a PDF file and returns either a fixed document or a portfolio depending on the PDF file type.
Parameters
fileName String
Path to source PDF file
password String
Password for decrypting the PDF file
Returns
PDFDocument
A PDFFixedDocument object or a PDFPortfolio object depending on the PDF file type.
Load(Stream)¶
Loads a PDF file and returns either a fixed document or a portfolio depending on the PDF file type.
Parameters
stream Stream
Stream that contains the PDF file.
Returns
PDFDocument
A PDFFixedDocument object or a PDFPortfolio object depending on the PDF file type.
Load(Stream, String)¶
Loads a PDF file and returns either a fixed document or a portfolio depending on the PDF file type.
Parameters
stream Stream
Stream that contains the PDF file.
password String
Password for decrypting the PDF file
Returns
PDFDocument
A PDFFixedDocument object or a PDFPortfolio object depending on the PDF file type.
Save(String)¶
Saves the PDF document to a file.
Parameters
fileName String
File where the PDF document is saved.
Save(String, PDFSecurityHandler)¶
Saves the PDF document to a file.
Parameters
fileName String
File where the PDF document is saved.
securityHandler PDFSecurityHandler
Security handler for encrypting the saved file.
Save(String, Boolean)¶
Saves the PDF document to a file.
Parameters
fileName String
File where the PDF document is saved.
enableObjectCompression Boolean
When set to true, the structure of the PDF objects is also compressed. Supported when PDF version >= 1.5
Save(String, PDFSecurityHandler, Boolean)¶
Saves the PDF document to a file.
Parameters
fileName String
File where the PDF 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)¶
Saves the PDF document to the specified stream.
Parameters
stream Stream
Destination stream.
Save(Stream, PDFSecurityHandler)¶
Saves the PDF document to the specified stream.
Parameters
stream Stream
Destination stream.
securityHandler PDFSecurityHandler
Security handler for encrypting the saved file.
Save(Stream, Boolean)¶
Saves the PDF document to the specified stream.
Parameters
stream Stream
Destination stream.
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