PdfLoadOptions Class
Represents options used for loading a PdfDocument from a PDF file.
- Inheritance:
- System.ObjectPdfLoadOptions
Constructors
PdfLoadOptions()
Initializes a new instance of the PdfLoadOptions class.
Properties
AuthorizationOnDocumentOpen
Gets or sets a value indicating whether authorization should be handled right away when PDF document is opened or when the first string or stream is read.
Default value: false.
public bool AuthorizationOnDocumentOpen { get; set; }
Public Property AuthorizationOnDocumentOpen As Boolean
Property Value
- System.Boolean
true if authorization should be handled right away when PDF document is opened; otherwise, false.
Default
Gets the default options used for loading any PdfDocument from a PDF file.
public static PdfLoadOptions Default { get; }
Public Shared ReadOnly Property Default As PdfLoadOptions
Property Value
The default options used for loading any PdfDocument from a PDF file.
Password
Gets or sets the password used to load a PDF document from a password-encrypted PDF file.
If PDF file is not encrypted, then this property is ignored.
If PDF file is encrypted and Password is invalid, then InvalidPdfPasswordException is thrown when loading a PDF document.
Property Value
- System.String
The password used to load a PDF document from a password-encrypted PDF file.
Exceptions
- System.ArgumentNullException
Value is null.
ReadOnly
Gets or sets a value indicating whether to load a PdfDocument from a read-only PDF file so that changes made to the PdfDocument cannot be saved back to the same PDF file.
When a PDF file is opened in Adobe Acrobat Reader, it will lock the file so no other process can write to the file while it is opened. Use this property to load a PdfDocument from the PDF file in a read-only mode while it is still opened in Adobe Acrobat Reader.
Also, if you want to open a PDF file in Adobe Acrobat Reader while the PdfDocument is loaded from the PDF file and before it is closed, then use this property to load a PdfDocument from a PDF file in a read-only mode.
Note that loading a PdfDocument from a PDF file in a read-only mode (without acquiring an exclusive write lock on the file) might lead to unpredictable behavior if the file is simultaneously changed by another process because the PDF file is read into memory incrementally and lazily. To prevent the unpredictable behavior at the expense of performance, use Load() method to read the entire PDF file into memory.
Default value: false.
Property Value
- System.Boolean
true to load PdfDocument from a read-only PDF file so that changes made to the PdfDocument cannot be saved back to the same PDF file; otherwise, false.
Events
LoadingEncrypted
Occurs when a PDF document is being loaded from an encrypted PDF file. This even must be handled in cases when some kind of authorization (for example, password) is required in order to decrypt the PDF file.
public event EventHandler<PdfLoadingEncryptedEventArgs> LoadingEncrypted
Public Event LoadingEncrypted As EventHandler(Of PdfLoadingEncryptedEventArgs)
Event Type
- System.EventHandler<PdfLoadingEncryptedEventArgs>