PdfSaveOptions Class
Represents options used for saving a PdfDocument to a PDF file.
public sealed class PdfSaveOptions : SaveOptions
Public NotInheritable Class PdfSaveOptions
Inherits SaveOptions
- Inheritance:
- System.ObjectPdfSaveOptions
Constructors
PdfSaveOptions()
Initializes a new instance of the PdfSaveOptions class.
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.
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.
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.
public PdfCrossReferenceType CrossReferenceType { get; set; }
Public Property CrossReferenceType As PdfCrossReferenceType
Property Value
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.
public static PdfSaveOptions Default { get; }
Public Shared ReadOnly Property Default As PdfSaveOptions
Property Value
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.
Property Value
The encryption-related information or null if a PDF document is not saved to an encrypted PDF file.
See Also
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.
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.
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.
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.
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.
public PdfPasswordEncryption SetPasswordEncryption()
Public Function SetPasswordEncryption As PdfPasswordEncryption
Returns
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 less | RC4_40 |
Version is PDF_1_4 or PDF_1_5 | RC4_128 |
Version is null or PDF_1_6 | AES_128 |
Version is PDF_1_7 or greater | AES_256 |
Inherited Properties
Image | Gets the default saving options for image file format. Image will be saved in Bmp format. (Inherited from SaveOptions) |
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) |