Aspose::Words::Saving::PdfSaveOptions class

PdfSaveOptions class

Can be used to specify additional options when saving a document into the Pdf format. To learn more, visit the Specify Save Options documentation article.

class PdfSaveOptions : public Aspose::Words::Saving::FixedPageSaveOptions

Methods

MethodDescription
Clone()Creates a deep clone of this object.
static CreateSaveOptions(Aspose::Words::SaveFormat)Creates a save options object of a class suitable for the specified save format.
static CreateSaveOptions(const System::String&)Creates a save options object of a class suitable for the file extension specified in the given file name.
Equals(System::SharedPtr<System::Object>) overrideDetermines whether the specified object is equal in value to the current object.
get_AdditionalTextPositioning() constA flag specifying whether to write additional text positioning operators or not.
get_AllowEmbeddingPostScriptFonts() constGets or sets a boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved. The default value is false.
get_CacheBackgroundGraphics() constGets or sets a value determining whether or not to cache graphics placed in document’s background.
get_ColorMode() constGets or sets a value determining how colors are rendered.
get_Compliance()Specifies the PDF standards compliance level for output documents.
get_CreateNoteHyperlinks() constSpecifies 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.
get_CustomPropertiesExport() constGets or sets a value determining the way CustomDocumentProperties are exported to PDF file.
get_CustomTimeZoneInfo() const
get_DefaultTemplate() constGets or sets path to default template (including filename). Default value for this property is empty string.
get_DigitalSignatureDetails() constGets or sets the details for signing the output PDF document.
get_DisplayDocTitle() constA flag specifying whether the window’s title bar should display the document title taken from the Title entry of the document information dictionary.
get_Dml3DEffectsRenderingMode() constGets a value determining how 3D effects are rendered.
get_DmlEffectsRenderingMode() overrideGets or sets a value determining how DrawingML effects are rendered.
get_DmlRenderingMode() constGets or sets a value determining how DrawingML shapes are rendered.
get_DownsampleOptions() constAllows to specify downsample options.
get_EmbedAttachments() constGets or sets a value determining whether or not to embed attachments to the PDF document.
get_EmbedFullFonts() constControls how fonts are embedded into the resulting PDF documents.
get_EncryptionDetails() constGets or sets the details for encrypting the output PDF document.
get_ExportDocumentStructure() constGets or sets a value determining whether or not to export document structure.
get_ExportGeneratorName() constWhen true, causes the name and version of Aspose.Words to be embedded into produced files. Default value is true.
get_ExportLanguageToSpanTag() constGets or sets a value determining whether or not to create a “Span” tag in the document structure to export the text language.
get_ExportParagraphGraphicsToArtifact() constGets or sets a value determining whether a paragraph graphic should be marked as an artifact.
get_FontEmbeddingMode() constSpecifies the font embedding mode.
get_HeaderFooterBookmarksExportMode() constDetermines how bookmarks in headers/footers are exported.
get_ImageColorSpaceExportMode() constSpecifies how the color space will be selected for the images in PDF document.
get_ImageCompression() constSpecifies compression type to be used for all images in the document.
get_ImlRenderingMode() constGets or sets a value determining how ink (InkML) objects are rendered.
get_InterpolateImages() constA 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.
get_JpegQuality()Gets or sets a value determining the quality of the JPEG images inside PDF document.
get_JpegQuality() constGets or sets a value determining the quality of the JPEG images inside Html document.
get_MemoryOptimization() constGets or sets value determining if memory optimization should be performed before saving the document. Default value for this property is false.
get_MetafileRenderingOptions() constAllows to specify metafile rendering options.
get_NumeralFormat() constGets or sets NumeralFormat used for rendering of numerals. European numerals are used by default.
get_OpenHyperlinksInNewWindow() constGets 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.
virtual get_OptimizeOutput()Flag indicates whether it is required to optimize output. If this flag is set redundant nested canvases and empty canvases are removed, also neighbor glyphs with the same formatting are concatenated. Note: The accuracy of the content display may be affected if this property is set to true. Default is false.
get_OutlineOptions() constAllows to specify outline options.
get_PageLayout() const
get_PageMode() constSpecifies how the PDF document should be displayed when opened in the PDF reader.
get_PageSavingCallback() constAllows to control how separate pages are saved when a document is exported to fixed page format.
get_PageSet() constGets or sets the pages to render. Default is all the pages in the document.
get_PreblendImages() constGets or sets a value determining whether or not to preblend transparent images with black background color.
get_PreserveFormFields() constSpecifies whether to preserve Microsoft Word form fields as form fields in PDF or convert them to text. Default is false.
get_PrettyFormat() constWhen true, pretty formats output where applicable. Default value is false.
get_ProgressCallback() constCalled during saving a document and accepts data about saving progress.
get_SaveFormat() overrideSpecifies the format in which the document will be saved if this save options object is used. Can only be Pdf.
get_TempFolder() constSpecifies the folder for temporary files used when saving to a DOC or DOCX file. By default this property is null and no temporary files are used.
get_TextCompression() constSpecifies compression type to be used for all textual content in the document.
get_UpdateCreatedTimeProperty() constGets a value determining whether the CreatedTime property is updated before saving. Default value is false;.
get_UpdateFields() constGets or sets a value determining if fields of certain types should be updated before saving the document to a fixed page format. Default value for this property is true.
get_UpdateLastPrintedProperty() constGets or sets a value determining whether the LastPrinted property is updated before saving.
get_UpdateLastSavedTimeProperty() constGets or sets a value determining whether the LastSavedTime property is updated before saving.
get_UseAntiAliasing() constGets or sets a value determining whether or not to use anti-aliasing for rendering.
get_UseBookFoldPrintingSettings() constGets or sets a boolean value indicating whether the document should be saved using a booklet printing layout, if it is specified via MultiplePages.
get_UseCoreFonts() constGets 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.
get_UseHighQualityRendering() constGets or sets a value determining whether or not to use high quality (i.e. slow) rendering algorithms.
get_ZoomBehavior() constGets or sets a value determining what type of zoom should be applied when a document is opened with a PDF viewer.
get_ZoomFactor() constGets or sets a value determining zoom factor (in percentages) for a document.
GetType() const override
Is(const System::TypeInfo&) const override
PdfSaveOptions()Initializes a new instance of this class that can be used to save a document in the Pdf format.
set_AdditionalTextPositioning(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_AdditionalTextPositioning.
set_AllowEmbeddingPostScriptFonts(bool)Setter for Aspose::Words::Saving::SaveOptions::get_AllowEmbeddingPostScriptFonts.
set_CacheBackgroundGraphics(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_CacheBackgroundGraphics.
set_ColorMode(Aspose::Words::Saving::ColorMode)Setter for Aspose::Words::Saving::FixedPageSaveOptions::get_ColorMode.
set_Compliance(Aspose::Words::Saving::PdfCompliance)Setter for Aspose::Words::Saving::PdfSaveOptions::get_Compliance.
set_CreateNoteHyperlinks(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_CreateNoteHyperlinks.
set_CustomPropertiesExport(Aspose::Words::Saving::PdfCustomPropertiesExport)Setter for Aspose::Words::Saving::PdfSaveOptions::get_CustomPropertiesExport.
set_CustomTimeZoneInfo(const System::SharedPtr<System::TimeZoneInfo>&)
set_DefaultTemplate(const System::String&)Setter for Aspose::Words::Saving::SaveOptions::get_DefaultTemplate.
set_DigitalSignatureDetails(const System::SharedPtr<Aspose::Words::Saving::PdfDigitalSignatureDetails>&)Setter for Aspose::Words::Saving::PdfSaveOptions::get_DigitalSignatureDetails.
set_DisplayDocTitle(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_DisplayDocTitle.
set_Dml3DEffectsRenderingMode(Aspose::Words::Saving::Dml3DEffectsRenderingMode)Sets a value determining how 3D effects are rendered.
set_DmlEffectsRenderingMode(Aspose::Words::Saving::DmlEffectsRenderingMode) overrideSetter for Aspose::Words::Saving::PdfSaveOptions::get_DmlEffectsRenderingMode.
set_DmlRenderingMode(Aspose::Words::Saving::DmlRenderingMode)Setter for Aspose::Words::Saving::SaveOptions::get_DmlRenderingMode.
set_DownsampleOptions(const System::SharedPtr<Aspose::Words::Saving::DownsampleOptions>&)Setter for Aspose::Words::Saving::PdfSaveOptions::get_DownsampleOptions.
set_EmbedAttachments(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_EmbedAttachments.
set_EmbedFullFonts(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_EmbedFullFonts.
set_EncryptionDetails(const System::SharedPtr<Aspose::Words::Saving::PdfEncryptionDetails>&)Setter for Aspose::Words::Saving::PdfSaveOptions::get_EncryptionDetails.
set_ExportDocumentStructure(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ExportDocumentStructure.
set_ExportGeneratorName(bool)Setter for Aspose::Words::Saving::SaveOptions::get_ExportGeneratorName.
set_ExportLanguageToSpanTag(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ExportLanguageToSpanTag.
set_ExportParagraphGraphicsToArtifact(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ExportParagraphGraphicsToArtifact.
set_FontEmbeddingMode(Aspose::Words::Saving::PdfFontEmbeddingMode)Setter for Aspose::Words::Saving::PdfSaveOptions::get_FontEmbeddingMode.
set_HeaderFooterBookmarksExportMode(Aspose::Words::Saving::HeaderFooterBookmarksExportMode)Setter for Aspose::Words::Saving::PdfSaveOptions::get_HeaderFooterBookmarksExportMode.
set_ImageColorSpaceExportMode(Aspose::Words::Saving::PdfImageColorSpaceExportMode)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ImageColorSpaceExportMode.
set_ImageCompression(Aspose::Words::Saving::PdfImageCompression)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ImageCompression.
set_ImlRenderingMode(Aspose::Words::Saving::ImlRenderingMode)Setter for Aspose::Words::Saving::SaveOptions::get_ImlRenderingMode.
set_InterpolateImages(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_InterpolateImages.
set_JpegQuality(int32_t)Setter for Aspose::Words::Saving::PdfSaveOptions::get_JpegQuality.
set_MemoryOptimization(bool)Setter for Aspose::Words::Saving::SaveOptions::get_MemoryOptimization.
set_MetafileRenderingOptions(const System::SharedPtr<Aspose::Words::Saving::MetafileRenderingOptions>&)Setter for Aspose::Words::Saving::FixedPageSaveOptions::get_MetafileRenderingOptions.
set_NumeralFormat(Aspose::Words::Saving::NumeralFormat)Setter for Aspose::Words::Saving::FixedPageSaveOptions::get_NumeralFormat.
set_OpenHyperlinksInNewWindow(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_OpenHyperlinksInNewWindow.
virtual set_OptimizeOutput(bool)Setter for Aspose::Words::Saving::FixedPageSaveOptions::get_OptimizeOutput.
set_PageLayout(Aspose::Words::Saving::PdfPageLayout)
set_PageMode(Aspose::Words::Saving::PdfPageMode)Setter for Aspose::Words::Saving::PdfSaveOptions::get_PageMode.
set_PageSavingCallback(const System::SharedPtr<Aspose::Words::Saving::IPageSavingCallback>&)Setter for Aspose::Words::Saving::FixedPageSaveOptions::get_PageSavingCallback.
set_PageSet(const System::SharedPtr<Aspose::Words::Saving::PageSet>&)Setter for Aspose::Words::Saving::FixedPageSaveOptions::get_PageSet.
set_PreblendImages(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_PreblendImages.
set_PreserveFormFields(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_PreserveFormFields.
set_PrettyFormat(bool)Setter for Aspose::Words::Saving::SaveOptions::get_PrettyFormat.
set_ProgressCallback(const System::SharedPtr<Aspose::Words::Saving::IDocumentSavingCallback>&)Setter for Aspose::Words::Saving::SaveOptions::get_ProgressCallback.
set_SaveFormat(Aspose::Words::SaveFormat) overrideSetter for Aspose::Words::Saving::PdfSaveOptions::get_SaveFormat.
set_TempFolder(const System::String&)Setter for Aspose::Words::Saving::SaveOptions::get_TempFolder.
set_TextCompression(Aspose::Words::Saving::PdfTextCompression)Setter for Aspose::Words::Saving::PdfSaveOptions::get_TextCompression.
set_UpdateCreatedTimeProperty(bool)Sets a value determining whether the CreatedTime property is updated before saving. Default value is false;.
set_UpdateFields(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UpdateFields.
set_UpdateLastPrintedProperty(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UpdateLastPrintedProperty.
set_UpdateLastSavedTimeProperty(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UpdateLastSavedTimeProperty.
set_UseAntiAliasing(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UseAntiAliasing.
set_UseBookFoldPrintingSettings(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_UseBookFoldPrintingSettings.
set_UseCoreFonts(bool)Setter for Aspose::Words::Saving::PdfSaveOptions::get_UseCoreFonts.
set_UseHighQualityRendering(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UseHighQualityRendering.
set_ZoomBehavior(Aspose::Words::Saving::PdfZoomBehavior)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ZoomBehavior.
set_ZoomFactor(int32_t)Setter for Aspose::Words::Saving::PdfSaveOptions::get_ZoomFactor.
static Type()

Examples

Shows how to convert a whole document to PDF with three levels in the document outline.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

// Insert headings of levels 1 to 5.
builder->get_ParagraphFormat()->set_StyleIdentifier(StyleIdentifier::Heading1);

ASSERT_TRUE(builder->get_ParagraphFormat()->get_IsHeading());

builder->Writeln(u"Heading 1");

builder->get_ParagraphFormat()->set_StyleIdentifier(StyleIdentifier::Heading2);

builder->Writeln(u"Heading 1.1");
builder->Writeln(u"Heading 1.2");

builder->get_ParagraphFormat()->set_StyleIdentifier(StyleIdentifier::Heading3);

builder->Writeln(u"Heading 1.2.1");
builder->Writeln(u"Heading 1.2.2");

builder->get_ParagraphFormat()->set_StyleIdentifier(StyleIdentifier::Heading4);

builder->Writeln(u"Heading 1.2.2.1");
builder->Writeln(u"Heading 1.2.2.2");

builder->get_ParagraphFormat()->set_StyleIdentifier(StyleIdentifier::Heading5);

builder->Writeln(u"Heading 1.2.2.2.1");
builder->Writeln(u"Heading 1.2.2.2.2");

// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();

// The output PDF document will contain an outline, which is a table of contents that lists headings in the document body.
// Clicking on an entry in this outline will take us to the location of its respective heading.
// Set the "HeadingsOutlineLevels" property to "4" to exclude all headings whose levels are above 4 from the outline.
options->get_OutlineOptions()->set_HeadingsOutlineLevels(4);

// If an outline entry has subsequent entries of a higher level inbetween itself and the next entry of the same or lower level,
// an arrow will appear to the left of the entry. This entry is the "owner" of several such "sub-entries".
// In our document, the outline entries from the 5th heading level are sub-entries of the second 4th level outline entry,
// the 4th and 5th heading level entries are sub-entries of the second 3rd level entry, and so on.
// In the outline, we can click on the arrow of the "owner" entry to collapse/expand all its sub-entries.
// Set the "ExpandedOutlineLevels" property to "2" to automatically expand all heading level 2 and lower outline entries
// and collapse all level and 3 and higher entries when we open the document.
options->get_OutlineOptions()->set_ExpandedOutlineLevels(2);

doc->Save(ArtifactsDir + u"PdfSaveOptions.ExpandedOutlineLevels.pdf", options);

Shows how to apply text compression when saving a document to PDF.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

for (int i = 0; i < 100; i++)
{
    builder->Writeln(String(u"Lorem ipsum dolor sit amet, consectetur adipiscing elit, ") +
                     u"sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
}

// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
auto options = MakeObject<PdfSaveOptions>();

// Set the "TextCompression" property to "PdfTextCompression.None" to not apply any
// compression to text when we save the document to PDF.
// Set the "TextCompression" property to "PdfTextCompression.Flate" to apply ZIP compression
// to text when we save the document to PDF. The larger the document, the bigger the impact that this will have.
options->set_TextCompression(pdfTextCompression);

doc->Save(ArtifactsDir + u"PdfSaveOptions.TextCompression.pdf", options);

Shows how to change image color with saving options property.

auto doc = MakeObject<Document>(MyDir + u"Images.docx");

// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
// Set the "ColorMode" property to "Grayscale" to render all images from the document in black and white.
// The size of the output document may be larger with this setting.
// Set the "ColorMode" property to "Normal" to render all images in color.
auto pdfSaveOptions = MakeObject<PdfSaveOptions>();
pdfSaveOptions->set_ColorMode(colorMode);

doc->Save(ArtifactsDir + u"PdfSaveOptions.ColorRendering.pdf", pdfSaveOptions);

See Also