Class PdfSaveOptions
Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.3.0)
Can be used to specify additional options when saving a document into the Aspose.Words.SaveFormat.Pdf format.
To learn more, visit the Specify Save Options documentation article.
public class PdfSaveOptions : FixedPageSaveOptions
Inheritance
object ← SaveOptions ← FixedPageSaveOptions ← PdfSaveOptions
Inherited Members
FixedPageSaveOptions.Equals(object), FixedPageSaveOptions.AssertValidIdPrefix(string), FixedPageSaveOptions.IsValidIdPrefix(string), FixedPageSaveOptions.PageSet, FixedPageSaveOptions.PageSavingCallback, FixedPageSaveOptions.NumeralFormat, FixedPageSaveOptions.MetafileRenderingOptions, FixedPageSaveOptions.JpegQuality, FixedPageSaveOptions.ColorMode, FixedPageSaveOptions.OptimizeOutput, SaveOptions.CreateSaveOptions(SaveFormat), SaveOptions.CreateSaveOptions(string), SaveOptions.SaveFormat, SaveOptions.ExportGeneratorName, SaveOptions.TempFolder, SaveOptions.PrettyFormat, SaveOptions.UseAntiAliasing, SaveOptions.UseHighQualityRendering, SaveOptions.DmlRenderingMode, SaveOptions.DmlEffectsRenderingMode, SaveOptions.ImlRenderingMode, SaveOptions.DefaultTemplate, SaveOptions.UpdateFields, SaveOptions.UpdateLastSavedTimeProperty, SaveOptions.UpdateLastPrintedProperty, SaveOptions.UpdateCreatedTimeProperty, SaveOptions.MemoryOptimization, SaveOptions.UpdateAmbiguousTextFont, SaveOptions.Dml3DEffectsRenderingMode, SaveOptions.ProgressCallback, SaveOptions.AllowEmbeddingPostScriptFonts, SaveOptions.CustomTimeZoneInfo, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
PdfSaveOptions()
Initializes a new instance of this class that can be used to save a document in the Aspose.Words.SaveFormat.Pdf format.
public PdfSaveOptions()
Properties
AdditionalTextPositioning
A flag specifying whether to write additional text positioning operators or not.
public bool AdditionalTextPositioning { get; set; }
Property Value
Remarks
If true
, additional text positioning operators are written to the output PDF. This may help to overcome
issues with inaccurate text positioning with some printers. The downside is the increased PDF document size.
The default value is false
.
AttachmentsEmbeddingMode
Gets or sets a value determining how attachments are embedded to the PDF document.
public PdfAttachmentsEmbeddingMode AttachmentsEmbeddingMode { get; set; }
Property Value
Remarks
Default value is Aspose.Words.Saving.PdfAttachmentsEmbeddingMode.None and attachments are not embedded.
PDF/A-1, PDF/A-2 and regular PDF/A-4 (not PDF/A-4f) standards do not allow embedded files. Aspose.Words.Saving.PdfAttachmentsEmbeddingMode.None value will be used automatically.
CacheBackgroundGraphics
Gets or sets a value determining whether or not to cache graphics placed in document’s background.
public bool CacheBackgroundGraphics { get; set; }
Property Value
Remarks
Default value is true
and background graphics are written to the PDF document as an xObject.
When the value is false
background graphics are not cached.
Some shapes are not supported for caching(shapes with fields, bookmarks, HRefs).
Document background graphic is various shapes, charts, images placed in the footer or header, well as background and border of a page.
Compliance
Specifies the PDF standards compliance level for output documents.
public PdfCompliance Compliance { get; set; }
Property Value
Remarks
Default is Aspose.Words.Saving.PdfCompliance.Pdf17.
CreateNoteHyperlinks
Specifies whether to convert footnote/endnote references in main text story into active hyperlinks.
When clicked the hyperlink will lead to the corresponding footnote/endnote.
Default is false
.
public bool CreateNoteHyperlinks { get; set; }
Property Value
CustomPropertiesExport
Gets or sets a value determining the way Aspose.Words.Document.CustomDocumentProperties are exported to PDF file.
public PdfCustomPropertiesExport CustomPropertiesExport { get; set; }
Property Value
Remarks
Default value is Aspose.Words.Saving.PdfCustomPropertiesExport.None.
Aspose.Words.Saving.PdfCustomPropertiesExport.Metadata value is not supported when saving to PDF/A. Aspose.Words.Saving.PdfCustomPropertiesExport.Standard will be used instead for PDF/A-1 and PDF/A-2 and Aspose.Words.Saving.PdfCustomPropertiesExport.None for PDF/A-4.
Aspose.Words.Saving.PdfCustomPropertiesExport.Standard value is not supported when saving to PDF 2.0. Aspose.Words.Saving.PdfCustomPropertiesExport.Metadata will be used instead.
DigitalSignatureDetails
Gets or sets the details for signing the output PDF document.
public PdfDigitalSignatureDetails DigitalSignatureDetails { get; set; }
Property Value
Remarks
The default value is null
and the output document will not be signed.
When this property is set to a valid Aspose.Words.Saving.PdfDigitalSignatureDetails object,
then the output PDF document will be digitally signed.
DisplayDocTitle
A flag specifying whether the window’s title bar should display the document title taken from the Title entry of the document information dictionary.
public bool DisplayDocTitle { get; set; }
Property Value
Remarks
If false
, the title bar should instead display the name of the PDF file containing the document.
This flag is required by PDF/UA compliance. true
value will be used automatically when saving
to PDF/UA.
The default value is false
.
DmlEffectsRenderingMode
Gets or sets a value determining how DrawingML effects are rendered.
public override DmlEffectsRenderingMode DmlEffectsRenderingMode { get; set; }
Property Value
Remarks
The default value is Aspose.Words.Saving.DmlEffectsRenderingMode.Simplified.
This property is used when the document is exported to fixed page formats.
If Aspose.Words.Saving.PdfSaveOptions.Compliance is set to Aspose.Words.Saving.PdfCompliance.PdfA1a or Aspose.Words.Saving.PdfCompliance.PdfA1b, property always returns Aspose.Words.Saving.DmlEffectsRenderingMode.None.
DownsampleOptions
Allows to specify downsample options.
public DownsampleOptions DownsampleOptions { get; set; }
Property Value
EmbedAttachments
Gets or sets a value determining whether or not to embed attachments to the PDF document.
[Obsolete("Obsolete, please use AttachmentsEmbeddingMode instead.")]
public bool EmbedAttachments { get; set; }
Property Value
Remarks
Default value is false
and attachments are not embedded.
When the value is true
attachments are embedded to the PDF document.
PDF/A-1, PDF/A-2 and PDF/A-4 (not level F) standards do not allow embedded files.
false
value will be used automatically.
Embedding attachments is not supported when encryption is enabled. false
value
will be used automatically.
EmbedFullFonts
Controls how fonts are embedded into the resulting PDF documents.
public bool EmbedFullFonts { get; set; }
Property Value
Remarks
The default value is false
, which means the fonts are subsetted before embedding.
Subsetting is useful if you want to keep the output file size smaller. Subsetting removes all
unused glyphs from a font.
When this value is set to true
, a complete font file is embedded into PDF without
subsetting. This will result in larger output files, but can be a useful option when you want to
edit the resulting PDF later (e.g. add more text).
Some fonts are large (several megabytes) and embedding them without subsetting will result in large output documents.
EncryptionDetails
Gets or sets the details for encrypting the output PDF document.
public PdfEncryptionDetails EncryptionDetails { get; set; }
Property Value
Remarks
The default value is null
and the output document will not be encrypted.
When this property is set to a valid Aspose.Words.Saving.PdfEncryptionDetails object,
then the output PDF document will be encrypted.
AES-128 encryption algorithm is used when saving to PDF 1.7 based compliance (including PDF/UA-1). AES-256 encryption algorithm is used when saving to PDF 2.0 based compliance.
Encryption is prohibited by PDF/A compliance. This option will be ignored when saving to PDF/A.
Aspose.Words.Saving.PdfPermissions.ContentCopyForAccessibility permission is required by PDF/UA compliance if the output document is encrypted. This permission will automatically used when saving to PDF/UA.
Aspose.Words.Saving.PdfPermissions.ContentCopyForAccessibility permission is deprecated in PDF 2.0 format. This permission will be ignored when saving to PDF 2.0.
ExportDocumentStructure
Gets or sets a value determining whether or not to export document structure.
public bool ExportDocumentStructure { get; set; }
Property Value
Remarks
This value is ignored when saving to PDF/A-1a, PDF/A-2a and PDF/UA-1 because document structure is required for this compliance.
Note that exporting the document structure significantly increases the memory consumption, especially for the large documents.
ExportLanguageToSpanTag
Gets or sets a value determining whether or not to create a “Span” tag in the document structure to export the text language.
public bool ExportLanguageToSpanTag { get; set; }
Property Value
Remarks
Default value is false
and "Lang" attribute is attached to a marked-content sequence in a page content stream.
When the value is true
"Span" tag is created for the text with non-default language
and "Lang" attribute is attached to this tag.
This value is ignored when Aspose.Words.Saving.PdfSaveOptions.ExportDocumentStructure is false
.
ExportParagraphGraphicsToArtifact
Gets or sets a value determining whether a paragraph graphic should be marked as an artifact.
public bool ExportParagraphGraphicsToArtifact { get; set; }
Property Value
Remarks
Default value is false
and paragraph graphics (underlines, text emphasis, etc.)
will be marked as "Span" in the logical structure of the document.
When the value is true
the paragraph graphics will be marked as "Artifact".
This value is ignored when Aspose.Words.Saving.PdfSaveOptions.ExportDocumentStructure is false
.
FontEmbeddingMode
Specifies the font embedding mode.
public PdfFontEmbeddingMode FontEmbeddingMode { get; set; }
Property Value
Remarks
The default value is Aspose.Words.Saving.PdfFontEmbeddingMode.EmbedAll.
This setting works only for the text in ANSI (Windows-1252) encoding. If the document contains non-ANSI text then corresponding fonts will be embedded regardless of this setting.
PDF/A and PDF/UA compliance requires all fonts to be embedded. Aspose.Words.Saving.PdfFontEmbeddingMode.EmbedAll value will be used automatically when saving to PDF/A and PDF/UA.
HeaderFooterBookmarksExportMode
Determines how bookmarks in headers/footers are exported.
public HeaderFooterBookmarksExportMode HeaderFooterBookmarksExportMode { get; set; }
Property Value
HeaderFooterBookmarksExportMode
Remarks
The default value is Aspose.Words.Saving.HeaderFooterBookmarksExportMode.All.
This property is used in conjunction with the Aspose.Words.Saving.PdfSaveOptions.OutlineOptions option.
ImageColorSpaceExportMode
Specifies how the color space will be selected for the images in PDF document.
public PdfImageColorSpaceExportMode ImageColorSpaceExportMode { get; set; }
Property Value
Remarks
The default value is Aspose.Words.Saving.PdfImageColorSpaceExportMode.Auto.
If Aspose.Words.Saving.PdfImageColorSpaceExportMode.SimpleCmyk value is specified, Aspose.Words.Saving.PdfSaveOptions.ImageCompression option is ignored and Flate compression is used for all images in the document.
Aspose.Words.Saving.PdfImageColorSpaceExportMode.SimpleCmyk value is not supported when saving to PDF/A. Aspose.Words.Saving.PdfImageColorSpaceExportMode.Auto value will be used instead.
ImageCompression
Specifies compression type to be used for all images in the document.
public PdfImageCompression ImageCompression { get; set; }
Property Value
Remarks
Default is Aspose.Words.Saving.PdfImageCompression.Auto.
Using Aspose.Words.Saving.PdfImageCompression.Jpeg lets you control the quality of images in the output document through the Aspose.Words.Saving.PdfSaveOptions.JpegQuality property.
Using Aspose.Words.Saving.PdfImageCompression.Jpeg provides the fastest conversion speed when compared to the performance of other compression types, but in this case, there is lossy JPEG compression.
Using Aspose.Words.Saving.PdfImageCompression.Auto lets to control the quality of Jpeg in the output document through the Aspose.Words.Saving.PdfSaveOptions.JpegQuality property, but for other formats, raw pixel data is extracted and saved with Flate compression. This case is slower than Jpeg conversion but lossless.
InterpolateImages
A flag indicating whether image interpolation shall be performed by a conforming reader.
When false
is specified, the flag is not written to the output document and
the default behaviour of reader is used instead.
public bool InterpolateImages { get; set; }
Property Value
Remarks
When the resolution of a source image is significantly lower than that of the output device, each source sample covers many device pixels. As a result, images can appear jaggy or blocky. These visual artifacts can be reduced by applying an image interpolation algorithm during rendering. Instead of painting all pixels covered by a source sample with the same color, image interpolation attempts to produce a smooth transition between adjacent sample values.
A conforming Reader may choose to not implement this feature of PDF, or may use any specific implementation of interpolation that it wishes.
The default value is false
.
Interpolation flag is prohibited by PDF/A compliance. false
value will be used automatically
when saving to PDF/A.
JpegQuality
Gets or sets a value determining the quality of the JPEG images inside PDF document.
public int JpegQuality { get; set; }
Property Value
Remarks
The default value is 100.
This property is used in conjunction with the Aspose.Words.Saving.PdfSaveOptions.ImageCompression option.
Has effect only when a document contains JPEG images.
Use this property to get or set the quality of the images inside a document when saving in PDF format. The value may vary from 0 to 100 where 0 means worst quality but maximum compression and 100 means best quality but minimum compression. If quality is 100 and source image is JPEG, it means no compression - original bytes will be saved.
OpenHyperlinksInNewWindow
Gets or sets a value determining whether hyperlinks in the output Pdf document are forced to be opened in a new window (or tab) of a browser.
public bool OpenHyperlinksInNewWindow { get; set; }
Property Value
Remarks
The default value is false
. When this value is set to true
hyperlinks are saved using JavaScript code.
JavaScript code is app.launchURL("URL", true);
,
where URL
is a hyperlink.
Note that if this option is set to true
hyperlinks can't work
in some PDF readers e.g. Chrome, Firefox.
JavaScript actions are prohibited by PDF/A-1 and PDF/A-2 compliance. false
will be used automatically when
saving to PDF/A-1 and PDF/A-2.
OutlineOptions
Allows to specify outline options.
public OutlineOptions OutlineOptions { get; }
Property Value
Remarks
Outlines can be created from headings and bookmarks.
For headings outline level is determined by the heading level.
It is possible to set the max heading level to be included into outlines or disable heading outlines at all.
For bookmarks outline level may be set in options as a default value for all bookmarks or as individual values for particular bookmarks.
Also, outlines can be exported to XPS format by using the same Aspose.Words.Saving.PdfSaveOptions.OutlineOptions class.
PageLayout
Specifies the page layout to be used when the document is opened in a PDF reader.
public PdfPageLayout PageLayout { get; set; }
Property Value
Remarks
The default value is Aspose.Words.Saving.PdfPageLayout.SinglePage.
PageMode
Specifies how the PDF document should be displayed when opened in a PDF reader.
public PdfPageMode PageMode { get; set; }
Property Value
Remarks
The default value is Aspose.Words.Saving.PdfPageMode.UseOutlines.
PreblendImages
Gets or sets a value determining whether or not to preblend transparent images with black background color.
public bool PreblendImages { get; set; }
Property Value
Remarks
Preblending images may improve PDF document visual appearance in Adobe Reader and remove anti-aliasing artifacts.
In order to properly display preblended images, PDF viewer application must support /Matte entry in soft-mask image dictionary. Also preblending images may decrease PDF rendering performance.
The default value is false
.
PreserveFormFields
Specifies whether to preserve Microsoft Word form fields as form fields in PDF or convert them to text.
Default is false
.
public bool PreserveFormFields { get; set; }
Property Value
Remarks
Microsoft Word form fields include text input, drop down and check box controls.
When set to false
, these fields will be exported as text to PDF. When set to true
,
these fields will be exported as PDF form fields.
When exporting form fields to PDF as form fields, some formatting loss might occur because PDF form fields do not support all features of Microsoft Word form fields.
Also, the output size depends on the content size because editable forms in Microsoft Word are inline objects.
Editable forms are prohibited by PDF/A compliance. false
value will be used automatically
when saving to PDF/A.
Form fields are not supported when saving to PDF/UA. false
value will be used automatically.
RenderChoiceFormFieldBorder
Specifies whether to render PDF choice form field border.
public bool RenderChoiceFormFieldBorder { get; set; }
Property Value
Remarks
PDF choice form fields are used for export of SDT Combo Box Content Control, SDT Drop-Down List Content Control and legacy Drop-Down Form Field when Aspose.Words.Saving.PdfSaveOptions.PreserveFormFields option is enabled.
The default value is true
.
SaveFormat
Specifies the format in which the document will be saved if this save options object is used. Can only be Aspose.Words.SaveFormat.Pdf.
public override SaveFormat SaveFormat { get; set; }
Property Value
TextCompression
Specifies compression type to be used for all textual content in the document.
public PdfTextCompression TextCompression { get; set; }
Property Value
Remarks
Default is Aspose.Words.Saving.PdfTextCompression.Flate.
Significantly increases output size when saving a document without compression.
UseBookFoldPrintingSettings
Gets or sets a boolean value indicating whether the document should be saved using a booklet printing layout, if it is specified via Aspose.Words.PageSetup.MultiplePages.
public bool UseBookFoldPrintingSettings { get; set; }
Property Value
Remarks
<p>
If this option is specified, Aspose.Words.Saving.FixedPageSaveOptions.PageSet is ignored when saving. This behavior matches MS Word. If book fold printing settings are not specified in page setup, this option will have no effect.
UseCoreFonts
Gets or sets a value determining whether or not to substitute TrueType fonts Arial, Times New Roman, Courier New and Symbol with core PDF Type 1 fonts.
public bool UseCoreFonts { get; set; }
Property Value
Remarks
The default value is false
. When this value is set to true
Arial, Times New Roman,
Courier New and Symbol fonts are replaced in PDF document with corresponding core Type 1 font.
Core PDF fonts, or their font metrics and suitable substitution fonts, are required to be available to any PDF viewer application.
This setting works only for the text in ANSI (Windows-1252) encoding. Non-ANSI text will be written with embedded TrueType font regardless of this setting.
PDF/A and PDF/UA compliance requires all fonts to be embedded. false
value will be used
automatically when saving to PDF/A and PDF/UA.
Core fonts are not supported when saving to PDF 2.0 format. false
value will be used
automatically when saving to PDF 2.0.
This option has a higher priority then Aspose.Words.Saving.PdfSaveOptions.FontEmbeddingMode option.
UseSdtTagAsFormFieldName
Specifies whether to use SDT control Tag or Id property as a name of form field in PDF.
public bool UseSdtTagAsFormFieldName { get; set; }
Property Value
Remarks
The default value is false
.
When set to false
, SDT control Id property is used as a name of form field in PDF.
When set to true
, SDT control Tag property is used as a name of form field in PDF.
If set to true
and Tag is empty, Id property will be used as a form field name.
If set to true
and Tag values are not unique, duplicate Tag values will be altered to build
unique PDF form field names.
ZoomBehavior
Gets or sets a value determining what type of zoom should be applied when a document is opened with a PDF viewer.
public PdfZoomBehavior ZoomBehavior { get; set; }
Property Value
Remarks
The default value is Aspose.Words.Saving.PdfZoomBehavior.None, i.e. no fit is applied.
ZoomFactor
Gets or sets a value determining zoom factor (in percentages) for a document.
public int ZoomFactor { get; set; }
Property Value
Remarks
This value is used only if Aspose.Words.Saving.PdfSaveOptions.ZoomBehavior is set to Aspose.Words.Saving.PdfZoomBehavior.ZoomFactor.
Methods
Clone()
Creates a deep clone of this object.
public PdfSaveOptions Clone()