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

    Show / Hide Table of Contents

    PdfSaveOptions Class

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

    Represents options used for saving a PdfDocument to a PDF file.

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

    Constructors

    PdfSaveOptions()

    Initializes a new instance of the PdfSaveOptions class.

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

    Properties

    CloseInput

    Gets or sets a value indicating whether to close the PDF file currently associated with the PdfDocument.

    This option is ignored if PdfDocument is not saved to a new file.

    Using this option has the same effect as calling Close() before saving the PdfDocument to a new file.

    Default value: true.

    • C#
    • VB.NET
    public bool CloseInput { get; set; }
    Public Property CloseInput As Boolean
    Property Value
    System.Boolean

    true if the PDF file currently associated with the PdfDocument should be closed; otherwise, false.

    CloseOutput

    Gets or sets a value indicating whether to close the new PDF file to which the PdfDocument will be saved.

    Using this option has the same effect as calling Close() after saving the PdfDocument.

    Default value: false.

    • C#
    • VB.NET
    public bool CloseOutput { get; set; }
    Public Property CloseOutput As Boolean
    Property Value
    System.Boolean

    true if the new PDF file to which the PdfDocument will be saved should be closed; otherwise, false.

    CrossReferenceType

    Gets a value indicating how cross-reference information (information about byte positions of the indirect objects) and indirect objects are stored in the PDF file.

    This option is ignored if PdfDocument is not saved to a new file.

    Default value: Table.

    • C#
    • VB.NET
    public PdfCrossReferenceType CrossReferenceType { get; set; }
    Public Property CrossReferenceType As PdfCrossReferenceType
    Property Value
    PdfCrossReferenceType

    A value indicating how cross-reference information (information about byte positions of the indirect objects) and indirect objects are stored in the PDF file.

    Default

    Gets the default options used for saving any PdfDocument to a PDF file.

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

    The default options used for saving any PdfDocument to a PDF file.

    Encryption

    Gets or sets the encryption-related information or null if a PDF document is not saved to an encrypted PDF file.

    • C#
    • VB.NET
    public PdfEncryption Encryption { get; set; }
    Public Property Encryption As PdfEncryption
    Property Value
    PdfEncryption

    The encryption-related information or null if a PDF document is not saved to an encrypted PDF file.

    See Also
    PDF Specification ISO 32000-1:2008, section '7.6 Encryption'

    UpdateDateInformation

    Gets or sets a value indicating whether to update CreationDate and/or ModificationDate before the PdfDocument is saved to a PDF file.

    If PdfDocument is saved to a new file, then CreationDate will be set to System.DateTimeOffset.Now and ModificationDate will be set to null.

    If PdfDocument is not saved to a new file, then ModificationDate will be set to System.DateTimeOffset.Now.

    Default value: true.

    • C#
    • VB.NET
    public bool UpdateDateInformation { get; set; }
    Public Property UpdateDateInformation As Boolean
    Property Value
    System.Boolean

    true to update CreationDate and/or ModificationDate before the PdfDocument is saved to a PDF file; otherwise, false.

    UpdateId

    Gets a value indicating whether to set or update Id before the PdfDocument is saved to a PDF file.

    If PdfDocument does not have an Id, then new PdfDocumentIdentifier will be assigned to it; otherwise, Modification of an existing PdfDocumentIdentifier will be updated.

    Default value: true.

    • C#
    • VB.NET
    public bool UpdateId { get; set; }
    Public Property UpdateId As Boolean
    Property Value
    System.Boolean

    true to set or update Id before the PdfDocument is saved to a PDF file; otherwise, false.

    UpdateProducerInformation

    Gets a value indicating whether to update Producer before the PdfDocument is saved to a PDF file.

    If set to true, then Producer will be set to user-friendly name of the GemBox.Pdf assembly.

    Default value: true.

    • C#
    • VB.NET
    public bool UpdateProducerInformation { get; set; }
    Public Property UpdateProducerInformation As Boolean
    Property Value
    System.Boolean

    true to update Producer before the PdfDocument is saved to a PDF file; otherwise, false.

    Version

    Gets or sets the version of the PDF specification to which the PdfDocument conforms specified in the PDF file's header (see 7.5.2, "File Header").

    This option is ignored if PdfDocument is not saved to a new file.

    Note that the PDF file's header version might be coerced to a value higher than the one specified in Version if the PDF file uses features that are not supported by the version specified in Version.

    If the value is null then PDF file's header version will be automatically set to a specific value depending on the features used in the PDF file.

    Default value: null.

    • C#
    • VB.NET
    public PdfVersion? Version { get; set; }
    Public Property Version As PdfVersion?
    Property Value
    System.Nullable<PdfVersion>

    The version of the PDF specification to which the PdfDocument conforms specified in the PDF file's header.

    Methods

    SetPasswordEncryption()

    Sets the PdfPasswordEncryption to a PDF file to which a PDF document is saved.

    Use the returned PdfPasswordEncryption to set the password(s) and other encryption-related information.

    Encryption method is set based on the value of the Version as specified in Remarks.

    • C#
    • VB.NET
    public PdfPasswordEncryption SetPasswordEncryption()
    Public Function SetPasswordEncryption As PdfPasswordEncryption
    Returns
    PdfPasswordEncryption

    An instance of the PdfPasswordEncryption that contains encryption-related information with which a PDF file is encrypted.

    Remarks

    Encryption method is set based on the value of the Version:

    Version is PDF_1_3 or lessRC4_40
    Version is PDF_1_4 or PDF_1_5RC4_128
    Version is null or PDF_1_6AES_128
    Version is PDF_1_7 or greaterAES_256

    Inherited Properties

    Image

    Gets the default saving options for image file format. Image will be saved in Bmp format.

    (Inherited from SaveOptions)

    Pdf

    Gets the default saving options for Portable Document Format (PDF).

    (Inherited from SaveOptions)

    Xps

    Gets the default saving options for XML Paper Specification (XPS) format.

    (Inherited from SaveOptions)

    Examples

    Encryption examples
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.