GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfLoadOptions Class

    Namespace:
    GemBox.Pdf
    Assembly:
    GemBox.Pdf.dll

    Represents options used for loading a PdfDocument from a PDF file.

    • C#
    • VB.NET
    public sealed class PdfLoadOptions
    Public NotInheritable Class PdfLoadOptions
    Inheritance:
    System.Object
    PdfLoadOptions

    Constructors

    PdfLoadOptions()

    Initializes a new instance of the PdfLoadOptions class.

    • C#
    • VB.NET
    public PdfLoadOptions()
    Public Sub New

    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    public static PdfLoadOptions Default { get; }
    Public Shared ReadOnly Property Default As PdfLoadOptions
    Property Value
    PdfLoadOptions

    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.

    • C#
    • VB.NET
    public string Password { get; set; }
    Public Property Password As String
    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.

    • C#
    • VB.NET
    public bool ReadOnly { get; set; }
    Public Property ReadOnly As Boolean
    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.

    • C#
    • VB.NET
    public event EventHandler<PdfLoadingEncryptedEventArgs> LoadingEncrypted
    Public Event LoadingEncrypted As EventHandler(Of PdfLoadingEncryptedEventArgs)
    Event Type
    System.EventHandler<PdfLoadingEncryptedEventArgs>
    See Also
    PDF Specification ISO 32000-1:2008, section '7.6 Encryption'

    Examples

    Decrypt example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.