Aspose::Words::Saving Namespace Reference

Detailed Description

The Aspose.Words.Saving namespace provides classes and enumerations that allow to specify additional options for saving or converting documents.

Classes

class  BookmarksOutlineLevelCollection
 A collection of individual bookmarks outline level. More...
 
class  CssSavingArgs
 Provides data for the CssSaving() event. More...
 
class  DocSaveOptions
 Can be used to specify additional options when saving a document into the Doc or Dot format. More...
 
class  DocumentPartSavingArgs
 Provides data for the DocumentPartSaving() callback. More...
 
class  DownsampleOptions
 Allows to specify downsample options. More...
 
class  FixedPageSaveOptions
 Contains common options that can be specified when saving a document into fixed page formats (PDF, XPS, images etc). More...
 
class  FontSavingArgs
 Provides data for the FontSaving() event. More...
 
class  HtmlFixedSaveOptions
 Can be used to specify additional options when saving a document into the HtmlFixed format. More...
 
class  HtmlSaveOptions
 Can be used to specify additional options when saving a document into the Html, Mhtml or Epub format. More...
 
interface  ICssSavingCallback
 
interface  IDocumentPartSavingCallback
 
interface  IFontSavingCallback
 
interface  IImageSavingCallback
 
class  ImageSaveOptions
 Allows to specify additional options when rendering document pages or shapes to images. More...
 
class  ImageSavingArgs
 Provides data for the ImageSaving() event. More...
 
interface  IPageSavingCallback
 
interface  IResourceSavingCallback
 
class  MarkdownSaveOptions
 Class to specify additional options when saving a document into the Markdown format. More...
 
class  MetafileRenderingOptions
 Allows to specify additional metafile rendering options. More...
 
class  OdtSaveOptions
 Can be used to specify additional options when saving a document into the Odt or Ott format. More...
 
class  OoxmlSaveOptions
 Can be used to specify additional options when saving a document into the Docx, Docm, Dotx, Dotm or FlatOpc format. More...
 
class  OutlineOptions
 Allows to specify outline options. More...
 
class  PageRange
 Represents a continuous range of pages. More...
 
class  PageSavingArgs
 Provides data for the PageSaving() event. More...
 
class  PageSet
 Describes a random set of pages. More...
 
class  PclSaveOptions
 Can be used to specify additional options when saving a document into the Pcl format. More...
 
class  PdfDigitalSignatureDetails
 Contains details for signing a PDF document with a digital signature. More...
 
class  PdfDigitalSignatureTimestampSettings
 Contains settings of the digital signature timestamp. More...
 
class  PdfEncryptionDetails
 Contains details for encrypting and access permissions for a PDF document. More...
 
class  PdfSaveOptions
 Can be used to specify additional options when saving a document into the Pdf format. More...
 
class  PsSaveOptions
 Can be used to specify additional options when saving a document into the Ps format. More...
 
class  ResourceSavingArgs
 Provides data for the ResourceSaving() event. More...
 
class  RtfSaveOptions
 Can be used to specify additional options when saving a document into the Rtf format. More...
 
class  SaveOptions
 This is an abstract base class for classes that allow the user to specify additional options when saving a document into a particular format. More...
 
class  SaveOutputParameters
 This object is returned to the caller after a document is saved and contains additional information that has been generated or calculated during the save operation. The caller can use or ignore this object. More...
 
class  SvgSaveOptions
 Can be used to specify additional options when saving a document into the Svg format. More...
 
class  TxtListIndentation
 Specifies how list levels are indented when document is exporting to Text format. More...
 
class  TxtSaveOptions
 Can be used to specify additional options when saving a document into the Text format. More...
 
class  TxtSaveOptionsBase
 The base class for specifying additional options when saving a document into a text based formats. More...
 
class  WordML2003SaveOptions
 Can be used to specify additional options when saving a document into the WordML format. More...
 
class  XamlFixedSaveOptions
 Can be used to specify additional options when saving a document into the XamlFixed format. More...
 
class  XamlFlowSaveOptions
 Can be used to specify additional options when saving a document into the XamlFlow or XamlFlowPack format. More...
 
class  XpsSaveOptions
 Can be used to specify additional options when saving a document into the Xps format. More...
 

Enumerations

enum  ColorMode
 Specifies how colors are rendered. More...
 
enum  CompressionLevel
 Compression level for OOXML files. (DOCX and DOTX files are internally a ZIP-archive, this property controls the compression level of the archive. Note, that FlatOpc file is not a ZIP-archive, therefore, this property does not affect the FlatOpc files.) More...
 
enum  CssStyleSheetType
 Specifies how CSS (Cascading Style Sheet) styles are exported to HTML. More...
 
enum  Dml3DEffectsRenderingMode
 Specifies how 3D shape effects are rendered. More...
 
enum  DmlEffectsRenderingMode
 Specifies how DrawingML effects are rendered to fixed page formats. More...
 
enum  DmlRenderingMode
 Specifies how DrawingML shapes are rendered to fixed page formats. More...
 
enum  DocumentSplitCriteria
 Specifies how the document is split into parts when saving to Html or Epub format. More...
 
enum  EmfPlusDualRenderingMode
 Specifies how Aspose.Words should render EMF+ Dual metafiles. More...
 
enum  ExportFontFormat
 Indicates the format that is used to export fonts while rendering to HTML fixed format. More...
 
enum  ExportHeadersFootersMode
 Specifies how headers and footers are exported to HTML, MHTML or EPUB. More...
 
enum  ExportListLabels
 Specifies how list labels are exported to HTML, MHTML and EPUB. More...
 
enum  HeaderFooterBookmarksExportMode
 Specifies how bookmarks in headers/footers are exported. More...
 
enum  HtmlElementSizeOutputMode
 Specifies how Aspose.Words exports element widths and heights to HTML, MHTML and EPUB. More...
 
enum  HtmlFixedPageHorizontalAlignment
 Specifies the horizontal alignment for pages in output HTML document. More...
 
enum  HtmlMetafileFormat
 Indicates the format in which metafiles are saved to HTML documents. More...
 
enum  HtmlOfficeMathOutputMode
 Specifies how Aspose.Words exports OfficeMath to HTML, MHTML and EPUB. More...
 
enum  HtmlVersion
 Indicates the version of HTML is used when saving the document to Html and Mhtml formats. More...
 
enum  ImageBinarizationMethod
 Specifies the method used to binarize image. More...
 
enum  ImageColorMode
 Specifies the color mode for the generated images of document pages. More...
 
enum  ImagePixelFormat
 Specifies the pixel format for the generated images of document pages. More...
 
enum  MetafileRenderingMode
 Specifies how Aspose.Words should render WMF and EMF metafiles. More...
 
enum  NumeralFormat
 Indicates the symbol set that is used to represent numbers while rendering to fixed page formats. More...
 
enum  OdtSaveMeasureUnit
 Specified units of measure to apply to measurable document content such as shape, widths and other during saving. More...
 
enum  OoxmlCompliance
 Allows to specify which OOXML specification will be used when saving in the DOCX format. More...
 
enum  PdfCompliance
 Specifies the PDF standards compliance level. More...
 
enum  PdfCustomPropertiesExport
 Specifies the way CustomDocumentProperties are exported to PDF file. More...
 
enum  PdfDigitalSignatureHashAlgorithm
 Specifies a digital hash algorithm used by a digital signature. More...
 
enum  PdfEncryptionAlgorithm
 Specifies the encryption algorithm to use for encrypting a PDF document. More...
 
enum  PdfFontEmbeddingMode
 Specifies how Aspose.Words should embed fonts. More...
 
enum  PdfImageColorSpaceExportMode
 Specifies how the color space will be selected for the images in PDF document. More...
 
enum  PdfImageCompression
 Specifies the type of compression applied to images in the PDF file. More...
 
enum  PdfPageMode
 Specifies how the PDF document should be displayed when opened in the PDF reader. More...
 
enum  PdfPermissions
 Specifies the operations that are allowed to a user on an encrypted PDF document. More...
 
enum  PdfTextCompression
 Specifies a type of compression applied to all content in the PDF file except images. More...
 
enum  PdfZoomBehavior
 Specifies the type of zoom applied to a PDF document when it is opened in a PDF viewer. More...
 
enum  SvgTextOutputMode
 
enum  TableContentAlignment
 Allows to specify the alignment of the content of the table to be used when exporting into Markdown format. More...
 
enum  TiffCompression
 Specifies what type of compression to apply when saving page images into a TIFF file. More...
 
enum  TxtExportHeadersFootersMode
 Specifies the way headers and footers are exported to plain text format. More...
 

Enumeration Type Documentation

◆ ColorMode

Specifies how colors are rendered.

Examples

Shows how change image color with save options property.

auto doc = MakeObject<Document>(MyDir + u"Images.docx");
// Configure PdfSaveOptions to save every image in the input document in greyscale during conversion
auto pdfSaveOptions = MakeObject<PdfSaveOptions>();
pdfSaveOptions->set_ColorMode(Aspose::Words::Saving::ColorMode::Grayscale);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ColorRendering.pdf", pdfSaveOptions);
Enumerator
Normal 

Rendering with unmodified colors.

Grayscale 

Rendering with colors in a range of gray shades from white to black.

◆ CompressionLevel

Compression level for OOXML files. (DOCX and DOTX files are internally a ZIP-archive, this property controls the compression level of the archive. Note, that FlatOpc file is not a ZIP-archive, therefore, this property does not affect the FlatOpc files.)

Enumerator
Normal 

Normal compression level. Default compression level used by Aspose.Words.

Maximum 

Maximum compression level.

Fast 

Fast compression level.

SuperFast 

Super Fast compression level. Microsoft Word uses this compression level.

◆ CssStyleSheetType

Specifies how CSS (Cascading Style Sheet) styles are exported to HTML.

See also
Aspose::Words::Saving::HtmlSaveOptions::get_CssStyleSheetType
Enumerator
Inline 

CSS styles are written inline (as a value of the style attribute on every element).

Embedded 

CSS styles are written separately from the content in a style sheet embedded in the HTML file.

External 

CSS styles are written separately from the content in a style sheet in an external file. The HTML file links the style sheet.

◆ Dml3DEffectsRenderingMode

Specifies how 3D shape effects are rendered.

Enumerator
Basic 

A lightweight and stable rendering, based on the internal engine, but advanced effects such as lighting, materials and other additional effects are not displayed when using this mode. Please see documentation for details.

Advanced 

Rendering of an extended list of special effects including advanced 3D effects such as bevels, lighting and materials.

◆ DmlEffectsRenderingMode

Specifies how DrawingML effects are rendered to fixed page formats.

Examples

Shows how to configure DrawingML rendering quality with PdfSaveOptions.

auto doc = MakeObject<Document>(MyDir + u"DrawingML shape effects.docx");
auto options = MakeObject<PdfSaveOptions>();
options->set_DmlEffectsRenderingMode(effectsRenderingMode);
ASSERT_EQ(Aspose::Words::Saving::DmlRenderingMode::DrawingML, options->get_DmlRenderingMode());
doc->Save(ArtifactsDir + u"PdfSaveOptions.DrawingMLEffects.pdf", options);
Enumerator
Simplified 

Rendering of DrawingML effects are simplified.

None 

No DrawingML effects are rendered.

Fine 

DrawingML effects are rendered in fine mode which involves advanced processing. In this mode rendering of effects gives better results but at a higher performance cost than Simplified mode.

◆ DmlRenderingMode

Specifies how DrawingML shapes are rendered to fixed page formats.

Examples

Shows how to configure DrawingML rendering quality with PdfSaveOptions.

auto doc = MakeObject<Document>(MyDir + u"DrawingML shape effects.docx");
auto options = MakeObject<PdfSaveOptions>();
options->set_DmlEffectsRenderingMode(effectsRenderingMode);
ASSERT_EQ(Aspose::Words::Saving::DmlRenderingMode::DrawingML, options->get_DmlRenderingMode());
doc->Save(ArtifactsDir + u"PdfSaveOptions.DrawingMLEffects.pdf", options);

Shows how to render fallback shapes when saving to Pdf.

auto doc = MakeObject<Document>(MyDir + u"DrawingML shape fallbacks.docx");
auto options = MakeObject<PdfSaveOptions>();
options->set_DmlRenderingMode(dmlRenderingMode);
doc->Save(ArtifactsDir + u"PdfSaveOptions.DrawingMLFallback.pdf", options);
Enumerator
Fallback 

If fall-back shape is available for DrawingML, Aspose.Words renders fall-back shape instead of the DrawingML.

DrawingML 

Aspose.Words ignores fall-back shape of DrawingML and renders DrawingML itself. This is the default mode.

◆ DocumentSplitCriteria

Specifies how the document is split into parts when saving to Html or Epub format.

DocumentSplitCriteria is a set of flags which can be combined. For instance you can split the document at page breaks and heading paragraphs in the same export operation.

Different criteria can partially overlap. For instance, Heading 1 style is frequently given PageBreakBefore property so it falls under two criteria: PageBreak and HeadingParagraph. Some section breaks can cause page breaks and so on. In typical cases specifying only one flag is the most practical option.

See also
Aspose::Words::Saving::HtmlSaveOptions::get_DocumentSplitCriteria
Examples

Shows how to convert a document to EPUB with save options specified.

// Open an existing document from disk
auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Create a new instance of HtmlSaveOptions. This object allows us to set options that control
// how the output document is saved
auto saveOptions = MakeObject<HtmlSaveOptions>();
// Specify the desired encoding
saveOptions->set_Encoding(System::Text::Encoding::get_UTF8());
// Specify at what elements to split the internal HTML at. This creates a new HTML within the EPUB
// which allows you to limit the size of each HTML part. This is useful for readers which cannot read
// HTML files greater than a certain size e.g 300kb
// Specify that we want to export document properties
saveOptions->set_ExportDocumentProperties(true);
// Specify that we want to save in EPUB format
saveOptions->set_SaveFormat(Aspose::Words::SaveFormat::Epub);
// Export the document as an EPUB file
doc->Save(ArtifactsDir + u"Document.Doc2EpubSaveOptions.epub", saveOptions);
Enumerator
None 

The document is not split.

PageBreak 

The document is split into parts at explicit page breaks. A page break can be specified by a PageBreak character, a section break specifying start of new section on a new page, or a paragraph that has its PageBreakBefore property set to true.

ColumnBreak 

The document is split into parts at column breaks. A column break can be specified by a ColumnBreak character or a section break specifying start of new section in a new column.

SectionBreak 

The document is split into parts at a section break of any type.

HeadingParagraph 

The document is split into parts at a paragraph formatted using a heading style Heading 1, Heading 2 etc. Use together with DocumentSplitHeadingLevel to specify the heading levels (from 1 to the specified level) at which to split.

◆ EmfPlusDualRenderingMode

Specifies how Aspose.Words should render EMF+ Dual metafiles.

Examples

Shows how to adjust EMF (Enhanced Windows Metafile) rendering options when saving to PDF.

auto doc = MakeObject<Document>(MyDir + u"EMF.docx");
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->get_MetafileRenderingOptions()->set_EmfPlusDualRenderingMode(renderingMode);
saveOptions->get_MetafileRenderingOptions()->set_UseEmfEmbeddedToWmf(true);
doc->Save(ArtifactsDir + u"PdfSaveOptions.RenderMetafile.pdf", saveOptions);
Enumerator
EmfPlusWithFallback 

Aspose.Words tries to render EMF+ part of EMF+ Dual metafile. If some of the EMF+ records are not supported then Aspose.Words renders EMF part of EMF+ Dual metafile.

EmfPlus 

Aspose.Words renders EMF+ part of EMF+ Dual metafile.

Emf 

Aspose.Words renders EMF part of EMF+ Dual metafile.

◆ ExportFontFormat

Indicates the format that is used to export fonts while rendering to HTML fixed format.

See also
Aspose::Words::Saving::HtmlFixedSaveOptions::get_FontFormat
Enumerator
Woff 

WOFF (Web Open Font Format).

Ttf 

TTF (TrueType Font format).

◆ ExportHeadersFootersMode

Specifies how headers and footers are exported to HTML, MHTML or EPUB.

See also
Aspose::Words::Saving::HtmlSaveOptions::get_ExportHeadersFootersMode
Examples

Demonstrates how to disable the export of headers and footers when saving to HTML based formats.

auto doc = MakeObject<Document>(MyDir + u"Header and footer types.docx");
// This document contains headers and footers, whose text contents can be looked up like this
ASSERT_EQ(u"First header", doc->get_FirstSection()->get_HeadersFooters()->idx_get(Aspose::Words::HeaderFooterType::HeaderFirst)->GetText().Trim());
// Formats such as html do not have a pre-defined equivalent for Microsoft Word headers/footers
// If we convert a document with headers and/or footers to html, they will be assimilated into body text
// We can use a SaveOptions object to omit headers/footers while converting to html
auto saveOptions = MakeObject<HtmlSaveOptions>(Aspose::Words::SaveFormat::Html);
saveOptions->set_ExportHeadersFootersMode(Aspose::Words::Saving::ExportHeadersFootersMode::None);
doc->Save(ArtifactsDir + u"HeaderFooter.DisableHeadersFooters.html", saveOptions);
// Open our saved document and verify that it does not contain the header's text
doc = MakeObject<Document>(ArtifactsDir + u"HeaderFooter.DisableHeadersFooters.html");
ASSERT_FALSE(doc->get_Range()->get_Text().Contains(u"First header"));
Enumerator
None 

Headers and footers are not exported.

PerSection 

Primary headers and footers are exported at the beginning and the end of each section.

FirstSectionHeaderLastSectionFooter 

Primary header of the first section is exported at the beginning of the document and primary footer is at the end.

FirstPageHeaderFooterPerSection 

First page header and footer are exported at the beginning and the end of each section.

◆ ExportListLabels

Specifies how list labels are exported to HTML, MHTML and EPUB.

See also
Aspose::Words::Saving::HtmlSaveOptions::get_ExportListLabels
Examples

Shows how to export an indented list to .html as plain text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Use the builder to insert a list
SharedPtr<Aspose::Words::Lists::List> list = doc->get_Lists()->Add(Aspose::Words::Lists::ListTemplate::NumberDefault);
builder->get_ListFormat()->set_List(list);
builder->Writeln(u"List item 1.");
builder->get_ListFormat()->ListIndent();
builder->Writeln(u"List item 2.");
builder->get_ListFormat()->ListIndent();
builder->Write(u"List item 3.");
// When we save this to .html, normally our list will be represented by <li> tags
// We can set this flag to have lists as plain text instead
auto options = MakeObject<HtmlSaveOptions>();
options->set_PrettyFormat(true);
doc->Save(ArtifactsDir + u"HtmlSaveOptions.List.html", options);
Enumerator
Auto 

Outputs list labels in auto mode. Uses HTML native elements when possible.

AsInlineText 

Outputs all list labels as inline text.

ByHtmlTags 

Outputs all list labels as HTML native elements.

◆ HeaderFooterBookmarksExportMode

Specifies how bookmarks in headers/footers are exported.

Examples

Shows how bookmarks in headers/footers are exported to pdf.

auto doc = MakeObject<Document>(MyDir + u"Bookmarks in headers and footers.docx");
// You can specify how bookmarks in headers/footers are exported
// There is a several options for this:
// "None" - Bookmarks in headers/footers are not exported
// "First" - Only bookmark in first header/footer of the section is exported
// "All" - Bookmarks in all headers/footers are exported
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->set_HeaderFooterBookmarksExportMode(headerFooterBookmarksExportMode);
saveOptions->get_OutlineOptions()->set_DefaultBookmarksOutlineLevel(1);
doc->Save(ArtifactsDir + u"PdfSaveOptions.HeaderFooterBookmarksExportMode.pdf", saveOptions);
Enumerator
None 

Bookmarks in headers/footers are not exported.

First 

Only bookmark in first header/footer of the section is exported.

All 

Bookmarks in all headers/footers are exported.

◆ HtmlElementSizeOutputMode

Specifies how Aspose.Words exports element widths and heights to HTML, MHTML and EPUB.

See also
Aspose::Words::Saving::HtmlSaveOptions::get_TableWidthOutputMode
Examples

Shows how to preserve negative indents in the output .html.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Insert a table and give it a negative value for its indent, effectively pushing it out of the left page boundary
SharedPtr<Table> table = builder->StartTable();
builder->InsertCell();
builder->Write(u"Cell 1");
builder->InsertCell();
builder->Write(u"Cell 2");
builder->EndTable();
table->set_LeftIndent(-36);
table->set_PreferredWidth(PreferredWidth::FromPoints(144));
// When saving to .html, this indent will only be preserved if we set this flag
auto options = MakeObject<HtmlSaveOptions>(Aspose::Words::SaveFormat::Html);
options->set_AllowNegativeIndent(true);
// The first cell with "Cell 1" will not be visible in the output
doc->Save(ArtifactsDir + u"HtmlSaveOptions.NegativeIndent.html", options);
Enumerator
All 

All element sizes, both in absolute and relative units, specified in the document are exported.

RelativeOnly 

Element sizes are exported only if they are specified in relative units in the document. Fixed sizes are not exported in this mode. Visual agents will calculate missing sizes to make document layout more natural.

None 

Element sizes are not exported. Visual agents will build layout automatically according to relationship between elements.

◆ HtmlFixedPageHorizontalAlignment

Specifies the horizontal alignment for pages in output HTML document.

Examples

Shows how to set the horizontal alignment of pages in HTML file.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto htmlFixedSaveOptions = MakeObject<HtmlFixedSaveOptions>();
htmlFixedSaveOptions->set_PageHorizontalAlignment(pageHorizontalAlignment);
doc->Save(ArtifactsDir + u"HtmlFixedSaveOptions.HorizontalAlignment.html", htmlFixedSaveOptions);
String outDocContents = System::IO::File::ReadAllText(ArtifactsDir + u"HtmlFixedSaveOptions.HorizontalAlignment/styles.css");
switch (pageHorizontalAlignment)
{
ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, u"[.]awpage { position:relative; border:solid 1pt black; margin:10pt auto 10pt auto; overflow:hidden; }")->get_Success());
break;
ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, u"[.]awpage { position:relative; border:solid 1pt black; margin:10pt auto 10pt 10pt; overflow:hidden; }")->get_Success());
break;
ASSERT_TRUE(System::Text::RegularExpressions::Regex::Match(outDocContents, u"[.]awpage { position:relative; border:solid 1pt black; margin:10pt 10pt 10pt auto; overflow:hidden; }")->get_Success());
break;
}
Enumerator
Left 

Align pages to the left.

Center 

Center pages. This is the default value.

Right 

Align pages to the right.

◆ HtmlMetafileFormat

Indicates the format in which metafiles are saved to HTML documents.

Examples

Shows how to set a meta file in a different format.

// Create a document from an html string
String html = u"<html>\r\n <svg xmlns='http://www.w3.org/2000/svg' width='500' height='40' viewBox='0 0 500 40'>\r\n <text x='0' y='35' font-family='Verdana' font-size='35'>Hello world!</text>\r\n </svg>\r\n </html>";
auto doc = MakeObject<Document>(MakeObject<System::IO::MemoryStream>(System::Text::Encoding::get_UTF8()->GetBytes(html)));
// This document contains a <svg> element in the form of text,
// which by default will be saved as a linked external .png when we save the document as html
// We can save with a HtmlSaveOptions object with this flag set to preserve the <svg> tag
auto options = MakeObject<HtmlSaveOptions>();
doc->Save(ArtifactsDir + u"HtmlSaveOptions.MetafileFormat.html", options);
Enumerator
Png 

Metafiles are rendered to raster PNG images.

Svg 

Metafiles are converted to vector SVG images.

EmfOrWmf 

Metafiles are saved as is, without conversion.

◆ HtmlOfficeMathOutputMode

Specifies how Aspose.Words exports OfficeMath to HTML, MHTML and EPUB.

Examples

Shows how to control the way how OfficeMath objects are exported to .html.

// Open a document that contains OfficeMath objects
auto doc = MakeObject<Document>(MyDir + u"Office math.docx");
// Create a HtmlSaveOptions object and configure it to export OfficeMath objects as images
auto options = MakeObject<HtmlSaveOptions>();
options->set_OfficeMathOutputMode(Aspose::Words::Saving::HtmlOfficeMathOutputMode::Image);
doc->Save(ArtifactsDir + u"HtmlSaveOptions.OfficeMathOutputMode.html", options);
Enumerator
Image 

OfficeMath is converted to HTML as image specified by <img> tag.

MathML 

OfficeMath is converted to HTML using MathML.

Text 

OfficeMath is converted to HTML as sequence of runs specified by <span> tags.

◆ HtmlVersion

Indicates the version of HTML is used when saving the document to Html and Mhtml formats.

Examples

Shows how to set a saved .html document to a specific version.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Save the document to a .html file of the XHTML 1.0 Transitional standard
auto options = MakeObject<HtmlSaveOptions>(Aspose::Words::SaveFormat::Html);
options->set_ExportXhtmlTransitional(true);
options->set_PrettyFormat(true);
// The DOCTYPE declaration at the top of this document will indicate the html version we chose
doc->Save(ArtifactsDir + u"HtmlSaveOptions.HtmlVersion.html", options);
Enumerator
Xhtml 

Saves the document in compliance with the XHTML 1.0 Transitional standard.

Aspose.Words aims to output XHTML according to the XHTML 1.0 Transitional standard, but the output will not always validate against the DTD. Some structures inside a Microsoft Word document are hard or impossible to map to a document that will validate against the XHTML schema. For example, XHTML does not allow nested lists (UL cannot be nested inside another UL element), but in Microsoft Word document multilevel lists occur quite often.

Html5 

Saves the document in compliance with the HTML 5 standard.

◆ ImageBinarizationMethod

Specifies the method used to binarize image.

Examples

Shows how to control the threshold for TIFF binarization in the Floyd-Steinberg method

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto options = MakeObject<ImageSaveOptions>(Aspose::Words::SaveFormat::Tiff);
options->set_TiffCompression(Aspose::Words::Saving::TiffCompression::Ccitt3);
options->set_ThresholdForFloydSteinbergDithering(254);
doc->Save(ArtifactsDir + u"ImageSaveOptions.FloydSteinbergDithering.tiff", options);
Enumerator
Threshold 

Specifies threshold method.

FloydSteinbergDithering 

Specifies dithering using Floyd-Steinberg error diffusion method.

◆ ImageColorMode

Specifies the color mode for the generated images of document pages.

Examples

Show how to convert document images to black and white with 1 bit per pixel

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto imageSaveOptions = MakeObject<ImageSaveOptions>(Aspose::Words::SaveFormat::Png);
imageSaveOptions->set_ImageColorMode(Aspose::Words::Saving::ImageColorMode::BlackAndWhite);
// ImageSaveOptions instances can be cloned
ASPOSE_ASSERT_NE(imageSaveOptions, imageSaveOptions->Clone());
doc->Save(ArtifactsDir + u"ImageSaveOptions.BlackAndWhite.png", imageSaveOptions);
Enumerator
None 

The pages of the document will be rendered as color images.

Grayscale 

The pages of the document will be rendered as grayscale images.

BlackAndWhite 

The pages of the document will be rendered as black and white images.

◆ ImagePixelFormat

Specifies the pixel format for the generated images of document pages.

Examples

Show how to convert document images to black and white with 1 bit per pixel

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto imageSaveOptions = MakeObject<ImageSaveOptions>(Aspose::Words::SaveFormat::Png);
imageSaveOptions->set_ImageColorMode(Aspose::Words::Saving::ImageColorMode::BlackAndWhite);
// ImageSaveOptions instances can be cloned
ASPOSE_ASSERT_NE(imageSaveOptions, imageSaveOptions->Clone());
doc->Save(ArtifactsDir + u"ImageSaveOptions.BlackAndWhite.png", imageSaveOptions);
Enumerator
Format16BppRgb555 

16 bits per pixel, RGB.

Format16BppRgb565 

16 bits per pixel, RGB.

Format16BppArgb1555 

16 bits per pixel, ARGB.

Format24BppRgb 

24 bits per pixel, RGB.

Format32BppRgb 

32 bits per pixel, RGB.

Format32BppArgb 

32 bits per pixel, ARGB.

Format32BppPArgb 

32 bits per pixel, ARGB, premultiplied alpha.

Format48BppRgb 

48 bits per pixel, RGB.

Format64BppArgb 

64 bits per pixel, ARGB.

Format64BppPArgb 

64 bits per pixel, ARGB, premultiplied alpha.

Format1bppIndexed 

1 bit per pixel, Indexed.

◆ MetafileRenderingMode

Specifies how Aspose.Words should render WMF and EMF metafiles.

Enumerator
VectorWithFallback 

Aspose.Words tries to render a metafile as vector graphics. If Aspose.Words cannot correctly render some of the metafile records to vector graphics then Aspose.Words renders this metafile to a bitmap.

Vector 

Aspose.Words renders a metafile as vector graphics.

Bitmap 

Aspose.Words invokes GDI+ to render a metafile to a bitmap and then saves the bitmap to the output document.

◆ NumeralFormat

Indicates the symbol set that is used to represent numbers while rendering to fixed page formats.

Examples

Demonstrates how to set the numeral format used when saving to PDF.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 50, 100");
auto options = MakeObject<PdfSaveOptions>();
doc->Save(ArtifactsDir + u"Rendering.SetNumeralFormat.pdf", options);
Enumerator
European 

European numerals: 0123456789.

ArabicIndic 

Numerals used in Arabic: ٠١٢٣٤٥٦٧٨٩. Unicode range U+0660 - u+0669.

EasternArabicIndic 

Numerals used in Persian and Urdu: ۰۱۲۳۴۵۶۷۸۹. Unicode range U+06F0 - u+06F9.

Context 

Symbol set is decided from context(locale and RTL property).

System 

THIS OPTION IS NOT SUPPORTED. Symbol set is decided from regional settings.

◆ OdtSaveMeasureUnit

Specified units of measure to apply to measurable document content such as shape, widths and other during saving.

Examples

Shows how to work with units of measure of document content.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Open Office uses centimeters, MS Office uses inches
auto saveOptions = MakeObject<OdtSaveOptions>();
saveOptions->set_IsStrictSchema11(doExportToOdt11Specs);
doc->Save(ArtifactsDir + u"OdtSaveOptions.MeasureUnit.odt", saveOptions);
Enumerator
Centimeters 

Specifies that the document content is saved using centimeters.

Inches 

Specifies that the document content is saved using inches.

◆ OoxmlCompliance

Allows to specify which OOXML specification will be used when saving in the DOCX format.

Examples

Shows conversion VML shapes to DML using ISO/IEC 29500:2008 Strict compliance level.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Set Word2003 version for document, for inserting image as VML shape
doc->get_CompatibilityOptions()->OptimizeFor(Aspose::Words::Settings::MsWordVersion::Word2003);
builder->InsertImage(ImageDir + u"Transparent background logo.png");
ASSERT_EQ(Aspose::Words::Drawing::ShapeMarkupLanguage::Vml, (System::DynamicCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true)))->get_MarkupLanguage());
// Iso29500_2008 does not allow VML shapes
// You need to use OoxmlCompliance.Iso29500_2008_Strict for converting VML to DML shapes
auto saveOptions = MakeObject<OoxmlSaveOptions>();
saveOptions->set_SaveFormat(Aspose::Words::SaveFormat::Docx);
doc->Save(ArtifactsDir + u"OoxmlSaveOptions.Iso29500Strict.docx", saveOptions);
// The markup language of our shape has changed according to the compliance type
doc = MakeObject<Document>(ArtifactsDir + u"OoxmlSaveOptions.Iso29500Strict.docx");
ASSERT_EQ(Aspose::Words::Drawing::ShapeMarkupLanguage::Dml, (System::DynamicCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true)))->get_MarkupLanguage());
Enumerator
Ecma376_2006 

ECMA-376 1st Edition, 2006.

Iso29500_2008_Transitional 

ISO/IEC 29500:2008 Transitional compliance level.

Iso29500_2008_Strict 

ISO/IEC 29500:2008 Strict compliance level.

◆ PdfCompliance

Specifies the PDF standards compliance level.

Examples

Shows how to save images to PDF using JPEG encoding to decrease file size.

auto doc = MakeObject<Document>(MyDir + u"Images.docx");
auto pdfSaveOptions = MakeObject<PdfSaveOptions>();
pdfSaveOptions->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptions->get_DownsampleOptions()->set_DownsampleImages(false);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.pdf", pdfSaveOptions);
auto pdfSaveOptionsA1B = MakeObject<PdfSaveOptions>();
pdfSaveOptionsA1B->set_Compliance(Aspose::Words::Saving::PdfCompliance::PdfA1b);
pdfSaveOptionsA1B->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptionsA1B->get_DownsampleOptions()->set_DownsampleImages(false);
// Use JPEG compression at 50% quality to reduce file size
pdfSaveOptionsA1B->set_JpegQuality(100);
pdfSaveOptionsA1B->set_ImageColorSpaceExportMode(Aspose::Words::Saving::PdfImageColorSpaceExportMode::SimpleCmyk);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.PDF_A_1_B.pdf", pdfSaveOptionsA1B);
auto pdfSaveOptionsA1A = MakeObject<PdfSaveOptions>();
pdfSaveOptionsA1A->set_Compliance(Aspose::Words::Saving::PdfCompliance::PdfA1a);
pdfSaveOptionsA1A->set_ExportDocumentStructure(true);
pdfSaveOptionsA1A->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptionsA1A->get_DownsampleOptions()->set_DownsampleImages(false);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.PDF_A_1_A.pdf", pdfSaveOptionsA1A);
Enumerator
Pdf17 

The output file will comply with the PDF 1.7 standard.

Pdf15 

The output file will comply with the PDF 1.5 standard.

PdfA1a 

The output file will comply with the PDF/A-1a standard. This level includes all the requirements of PDF/A-1b and additionally requires that document structure be included (also known as being "tagged"), with the objective of ensuring that document content can be searched and repurposed.

PdfA1b 

The output file will comply with the PDF/A-1b standard. PDF/A-1b has the objective of ensuring reliable reproduction of the visual appearance of the document.

◆ PdfCustomPropertiesExport

Specifies the way CustomDocumentProperties are exported to PDF file.

Examples

Shows how to export custom properties while saving to .pdf.

auto doc = MakeObject<Document>();
// Add a custom document property that doesn't use the name of some built in properties
doc->get_CustomDocumentProperties()->Add(u"Company", String(u"My value"));
// Configure the PdfSaveOptions like this will display the properties
// in the "Document Properties" menu of Adobe Acrobat Pro
auto options = MakeObject<PdfSaveOptions>();
options->set_CustomPropertiesExport(pdfCustomPropertiesExportMode);
doc->Save(ArtifactsDir + u"PdfSaveOptions.CustomPropertiesExport.pdf", options);
Enumerator
None 

No custom properties are exported.

Standard 

Custom properties are exported as entries in /Info dictionary. Custom properties with the following names are not exported: "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "CreationDate", "ModDate", "Trapped".

Metadata 

Custom properties are Metadata.

The namespace of exported properties in XMP packet is "custprops". Every property has an associated xml-element "custprops:Property1", "custprops:Property2" and so on. There is "rdf:Description" element inside property element. The description element has two elements "custprops:Name", containing custom property's name as a value of this xml-element, and "custprops:Value", containing custom property's value as value of this xml-element.

◆ PdfDigitalSignatureHashAlgorithm

Specifies a digital hash algorithm used by a digital signature.

Examples

Shows how to sign a generated PDF using Aspose.Words.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Signed PDF contents.");
// Load the certificate from disk
// The other constructor overloads can be used to load certificates from different locations
SharedPtr<CertificateHolder> certificateHolder = CertificateHolder::Create(MyDir + u"morzal.pfx", u"aw");
// Pass the certificate and details to the save options class to sign with
auto options = MakeObject<PdfSaveOptions>();
options->set_DigitalSignatureDetails(MakeObject<PdfDigitalSignatureDetails>(certificateHolder, u"Test Signing", u"Aspose Office", signingTime));
// We can use this attribute to set a different hash algorithm
options->get_DigitalSignatureDetails()->set_HashAlgorithm(Aspose::Words::Saving::PdfDigitalSignatureHashAlgorithm::Sha256);
ASSERT_EQ(u"Test Signing", options->get_DigitalSignatureDetails()->get_Reason());
ASSERT_EQ(u"Aspose Office", options->get_DigitalSignatureDetails()->get_Location());
ASSERT_EQ(signingTime.ToUniversalTime(), options->get_DigitalSignatureDetails()->get_SignatureDate());
doc->Save(ArtifactsDir + u"PdfSaveOptions.PdfDigitalSignature.pdf", options);
Enumerator
Sha1 

SHA-1 hash algorithm.

Sha256 

SHA-256 hash algorithm.

Sha384 

SHA-384 hash algorithm.

Sha512 

SHA-512 hash algorithm.

Md5 

SHA-1 hash algorithm.

◆ PdfEncryptionAlgorithm

Specifies the encryption algorithm to use for encrypting a PDF document.

Examples

Demonstrates how to set permissions on a PDF document generated by Aspose.Words.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto saveOptions = MakeObject<PdfSaveOptions>();
// Create encryption details and set owner password
auto encryptionDetails = MakeObject<PdfEncryptionDetails>(u"password", String::Empty, Aspose::Words::Saving::PdfEncryptionAlgorithm::RC4_128);
// Start by disallowing all permissions
encryptionDetails->set_Permissions(Aspose::Words::Saving::PdfPermissions::DisallowAll);
// Extend permissions to allow editing or modifying annotations
saveOptions->set_EncryptionDetails(encryptionDetails);
// Render the document to PDF format with the specified permissions
doc->Save(ArtifactsDir + u"Rendering.EncryptionPermissions.pdf", saveOptions);
Enumerator
RC4_40 

RC4 encryption, key length of 40 bits.

RC4_128 

RC4 encryption, key length of 128 bits.

◆ PdfFontEmbeddingMode

Specifies how Aspose.Words should embed fonts.

Examples

Shows how to set Aspose.Words to skip embedding Arial and Times New Roman fonts into a PDF document.

// Load the document to render
auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// To disable embedding standard windows font use the PdfSaveOptions and set the EmbedStandardWindowsFonts property to false
auto options = MakeObject<PdfSaveOptions>();
// The output PDF will be saved without embedding standard windows fonts
doc->Save(ArtifactsDir + u"Rendering.DisableEmbedWindowsFonts.pdf", options);
Enumerator
EmbedAll 

Aspose.Words embeds all fonts.

EmbedNonstandard 

Aspose.Words embeds all fonts excepting standard Windows fonts Arial and Times New Roman. Only Arial and Times New Roman fonts are affected in this mode because MS Word doesn't embed only these fonts when saving document to PDF.

EmbedNone 

Aspose.Words do not embed any fonts.

◆ PdfImageColorSpaceExportMode

Specifies how the color space will be selected for the images in PDF document.

Examples

Shows how to save images to PDF using JPEG encoding to decrease file size.

auto doc = MakeObject<Document>(MyDir + u"Images.docx");
auto pdfSaveOptions = MakeObject<PdfSaveOptions>();
pdfSaveOptions->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptions->get_DownsampleOptions()->set_DownsampleImages(false);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.pdf", pdfSaveOptions);
auto pdfSaveOptionsA1B = MakeObject<PdfSaveOptions>();
pdfSaveOptionsA1B->set_Compliance(Aspose::Words::Saving::PdfCompliance::PdfA1b);
pdfSaveOptionsA1B->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptionsA1B->get_DownsampleOptions()->set_DownsampleImages(false);
// Use JPEG compression at 50% quality to reduce file size
pdfSaveOptionsA1B->set_JpegQuality(100);
pdfSaveOptionsA1B->set_ImageColorSpaceExportMode(Aspose::Words::Saving::PdfImageColorSpaceExportMode::SimpleCmyk);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.PDF_A_1_B.pdf", pdfSaveOptionsA1B);
auto pdfSaveOptionsA1A = MakeObject<PdfSaveOptions>();
pdfSaveOptionsA1A->set_Compliance(Aspose::Words::Saving::PdfCompliance::PdfA1a);
pdfSaveOptionsA1A->set_ExportDocumentStructure(true);
pdfSaveOptionsA1A->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptionsA1A->get_DownsampleOptions()->set_DownsampleImages(false);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.PDF_A_1_A.pdf", pdfSaveOptionsA1A);
Enumerator
Auto 

Aspose.Words automatically selects the most appropriate color space for each image.

Most of the images are saved in RGB color space. Also Indexed and Grayscale color spaces may be used. CMYK color space is never used.

For some images the color space may be different on different platforms.

SimpleCmyk 

Aspose.Words coverts RGB images to CMYK color space using simple formula.

Images in RGB color space are converted to CMYK using formula: Black = minimum(1-Red,1-Green,1-Blue). Cyan = (1-Red-Black)/(1-Black). Magenta = (1-Green-Black)/(1-Black). Yellow = (1-Blue-Black)/(1-Black). RGB values are normalized - they are between 0 and 1.0.

◆ PdfImageCompression

Specifies the type of compression applied to images in the PDF file.

Examples

Shows how to save images to PDF using JPEG encoding to decrease file size.

auto doc = MakeObject<Document>(MyDir + u"Images.docx");
auto pdfSaveOptions = MakeObject<PdfSaveOptions>();
pdfSaveOptions->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptions->get_DownsampleOptions()->set_DownsampleImages(false);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.pdf", pdfSaveOptions);
auto pdfSaveOptionsA1B = MakeObject<PdfSaveOptions>();
pdfSaveOptionsA1B->set_Compliance(Aspose::Words::Saving::PdfCompliance::PdfA1b);
pdfSaveOptionsA1B->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptionsA1B->get_DownsampleOptions()->set_DownsampleImages(false);
// Use JPEG compression at 50% quality to reduce file size
pdfSaveOptionsA1B->set_JpegQuality(100);
pdfSaveOptionsA1B->set_ImageColorSpaceExportMode(Aspose::Words::Saving::PdfImageColorSpaceExportMode::SimpleCmyk);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.PDF_A_1_B.pdf", pdfSaveOptionsA1B);
auto pdfSaveOptionsA1A = MakeObject<PdfSaveOptions>();
pdfSaveOptionsA1A->set_Compliance(Aspose::Words::Saving::PdfCompliance::PdfA1a);
pdfSaveOptionsA1A->set_ExportDocumentStructure(true);
pdfSaveOptionsA1A->set_ImageCompression(Aspose::Words::Saving::PdfImageCompression::Jpeg);
pdfSaveOptionsA1A->get_DownsampleOptions()->set_DownsampleImages(false);
doc->Save(ArtifactsDir + u"PdfSaveOptions.ImageCompression.PDF_A_1_A.pdf", pdfSaveOptionsA1A);
Enumerator
Auto 

Automatically selects the most appropriate compression for each image.

Jpeg 

Jpeg compression. Does not support transparency.

◆ PdfPageMode

Specifies how the PDF document should be displayed when opened in the PDF reader.

Examples

Shows how bookmarks in headers/footers are exported to pdf.

auto doc = MakeObject<Document>(MyDir + u"Bookmarks in headers and footers.docx");
// You can specify how bookmarks in headers/footers are exported
// There is a several options for this:
// "None" - Bookmarks in headers/footers are not exported
// "First" - Only bookmark in first header/footer of the section is exported
// "All" - Bookmarks in all headers/footers are exported
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->set_HeaderFooterBookmarksExportMode(headerFooterBookmarksExportMode);
saveOptions->get_OutlineOptions()->set_DefaultBookmarksOutlineLevel(1);
doc->Save(ArtifactsDir + u"PdfSaveOptions.HeaderFooterBookmarksExportMode.pdf", saveOptions);

Shows how to set instructions for some PDF readers to follow when opening an output document.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
auto options = MakeObject<PdfSaveOptions>();
options->set_PageMode(pageMode);
doc->Save(ArtifactsDir + u"PdfSaveOptions.PageMode.pdf", options);
Enumerator
UseNone 

Neither document outline nor thumbnail images are visible.

UseOutlines 

Document outline is visible. Note that if there're no outlines in the PDF document then outline navigation pane will not be visible anyway.

UseThumbs 

Thumbnail images are visible.

FullScreen 

Full-screen mode, with no menu bar, window controls, or any other window visible.

UseOC 

Optional content group panel is visible.

◆ PdfPermissions

Specifies the operations that are allowed to a user on an encrypted PDF document.

Examples

Demonstrates how to set permissions on a PDF document generated by Aspose.Words.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto saveOptions = MakeObject<PdfSaveOptions>();
// Create encryption details and set owner password
auto encryptionDetails = MakeObject<PdfEncryptionDetails>(u"password", String::Empty, Aspose::Words::Saving::PdfEncryptionAlgorithm::RC4_128);
// Start by disallowing all permissions
encryptionDetails->set_Permissions(Aspose::Words::Saving::PdfPermissions::DisallowAll);
// Extend permissions to allow editing or modifying annotations
saveOptions->set_EncryptionDetails(encryptionDetails);
// Render the document to PDF format with the specified permissions
doc->Save(ArtifactsDir + u"Rendering.EncryptionPermissions.pdf", saveOptions);
Enumerator
DisallowAll 

Disallows all operations on the PDF document. This is the default value.

AllowAll 

Allows all operations on the PDF document.

ContentCopy 

Allows copying or otherwise extracting text and graphics from the document, including extraction for accessibility purposes.

ContentCopyForAccessibility 

Allows extract text and graphics in support of accessibility to disabled users or for other purposes. When using RC4 40-bit encryption, this option is ignored and accessibility is allowed whenever ContentCopy is set.

ModifyContents 

Allows modifying the document’s contents.

ModifyAnnotations 

Allows adding or modifying text annotations. When using RC4 40-bit encryption, this option also allows filling in form fields.

FillIn 

Allows filling in forms and signing the document. When using RC4 40-bit encryption, this option is ignored and filling in form is allowed whenever ModifyAnnotations is set.

DocumentAssembly 

Allows assembling the document: inserting, rotating, or deleting pages and creating navigation elements such as bookmarks or thumbnail images. When using RC4 40-bit encryption, this option is ignored and document assembly is allowed when ModifyContents is set.

Printing 

Allows printing the document.

HighResolutionPrinting 

Allows printing the document to the highest resolution possible. When using RC4 40-bit encryption, this option is ignored and high resolution printing is allowed when Printing is set.

◆ PdfTextCompression

Specifies a type of compression applied to all content in the PDF file except images.

Examples

Saves a document to PDF without compression.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto options = MakeObject<PdfSaveOptions>();
doc->Save(ArtifactsDir + u"Rendering.SaveToPdfNoCompression.pdf", options);
Enumerator
None 

No compression.

Flate 

Flate (ZIP) compression.

◆ PdfZoomBehavior

Specifies the type of zoom applied to a PDF document when it is opened in a PDF viewer.

Examples

Shows how to set the default zooming of an output PDF to 1/4 of default size.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto options = MakeObject<PdfSaveOptions>();
options->set_ZoomFactor(25);
// Upon opening the .pdf with a viewer such as Adobe Acrobat Pro, the zoom level will be at 25% by default,
// with thumbnails for each page to the left
doc->Save(ArtifactsDir + u"PdfSaveOptions.ZoomBehaviour.pdf", options);
Enumerator
None 

How the document is displayed is left to the PDF viewer. Usually the viewer displays the document to fit page width.

ZoomFactor 

Displays the page using the specified zoom factor.

FitPage 

Displays the page so it visible entirely.

FitWidth 

Fits the width of the page.

FitHeight 

Fits the height of the page.

FitBox 

Fits the bounding box (rectangle containing all visible elements on the page).

◆ SvgTextOutputMode

Examples

Shows how to mimic the properties of images when converting a .docx document to .svg.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
// Configure the SvgSaveOptions object to save with no page borders or selectable text
auto options = MakeObject<SvgSaveOptions>();
options->set_FitToViewPort(true);
options->set_ShowPageBorder(false);
doc->Save(ArtifactsDir + u"SvgSaveOptions.SaveLikeImage.svg", options);
Enumerator
UseSvgFonts 

SVG fonts are used to render text. Note, not all browsers support SVG fonts.

UseTargetMachineFonts 

Fonts installed on the target machine are used to render text. Note, if some of fonts used in the document are not available on the target machine, document can look differently.

UsePlacedGlyphs 

Text is rendered using curves. Note, text selection will not work if you use this option.

◆ TableContentAlignment

Allows to specify the alignment of the content of the table to be used when exporting into Markdown format.

Enumerator
Auto 

The alignment will be taken from the first paragraph in corresponding table column.

Left 

The content of tables will be aligned to the Left.

Center 

The content of tables will be aligned to the Center.

Right 

The content of tables will be aligned to the Right.

◆ TiffCompression

Specifies what type of compression to apply when saving page images into a TIFF file.

Examples

Converts a page of a Word document into a TIFF image and uses the CCITT compression.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
auto options = MakeObject<ImageSaveOptions>(Aspose::Words::SaveFormat::Tiff);
options->set_TiffCompression(Aspose::Words::Saving::TiffCompression::Ccitt3);
options->set_PageIndex(0);
options->set_PageCount(1);
doc->Save(ArtifactsDir + u"Rendering.SaveToTiffCompression.tiff", options);
Enumerator
None 

Specifies no compression.

Rle 

Specifies the RLE compression scheme.

Lzw 

Specifies the LZW compression scheme. In Java emulated by Deflate (Zip) compression.

Ccitt3 

Specifies the CCITT3 compression scheme.

Ccitt4 

Specifies the CCITT4 compression scheme.

◆ TxtExportHeadersFootersMode

Specifies the way headers and footers are exported to plain text format.

Examples

Shows how to specifies the way headers and footers are exported to plain text format.

auto doc = MakeObject<Document>();
// Insert even and primary headers/footers into the document
// The primary header/footers should override the even ones
doc->get_FirstSection()->get_HeadersFooters()->Add(MakeObject<HeaderFooter>(doc, Aspose::Words::HeaderFooterType::HeaderEven));
doc->get_FirstSection()->get_HeadersFooters()->idx_get(Aspose::Words::HeaderFooterType::HeaderEven)->AppendParagraph(u"Even header");
doc->get_FirstSection()->get_HeadersFooters()->Add(MakeObject<HeaderFooter>(doc, Aspose::Words::HeaderFooterType::FooterEven));
doc->get_FirstSection()->get_HeadersFooters()->idx_get(Aspose::Words::HeaderFooterType::FooterEven)->AppendParagraph(u"Even footer");
doc->get_FirstSection()->get_HeadersFooters()->Add(MakeObject<HeaderFooter>(doc, Aspose::Words::HeaderFooterType::HeaderPrimary));
doc->get_FirstSection()->get_HeadersFooters()->idx_get(Aspose::Words::HeaderFooterType::HeaderPrimary)->AppendParagraph(u"Primary header");
doc->get_FirstSection()->get_HeadersFooters()->Add(MakeObject<HeaderFooter>(doc, Aspose::Words::HeaderFooterType::FooterPrimary));
doc->get_FirstSection()->get_HeadersFooters()->idx_get(Aspose::Words::HeaderFooterType::FooterPrimary)->AppendParagraph(u"Primary footer");
// Insert pages that would display these headers and footers
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"Page 1");
builder->Writeln(u"Page 2");
builder->Write(u"Page 3");
// Three values are available in TxtExportHeadersFootersMode enum:
// "None" - No headers and footers are exported
// "AllAtEnd" - All headers and footers are placed after all section bodies at the very end of a document
// "PrimaryOnly" - Only primary headers and footers are exported at the beginning and end of each section (default value)
auto saveOptions = MakeObject<TxtSaveOptions>();
saveOptions->set_ExportHeadersFootersMode(txtExportHeadersFootersMode);
doc->Save(ArtifactsDir + u"TxtSaveOptions.ExportHeadersFooters.txt", saveOptions);
String docText = System::IO::File::ReadAllText(ArtifactsDir + u"TxtSaveOptions.ExportHeadersFooters.txt");
switch (txtExportHeadersFootersMode)
{
ASSERT_EQ(String(u"Page 1\r\n") + u"Page 2\r\n" + u"Page 3\r\n" + u"Even header\r\n\r\n" + u"Primary header\r\n\r\n" + u"Even footer\r\n\r\n" + u"Primary footer\r\n\r\n", docText);
break;
ASSERT_EQ(String(u"Primary header\r\n") + u"Page 1\r\n" + u"Page 2\r\n" + u"Page 3\r\n" + u"Primary footer\r\n", docText);
break;
ASSERT_EQ(String(u"Page 1\r\n") + u"Page 2\r\n" + u"Page 3\r\n", docText);
break;
}
Enumerator
None 

No headers and footers are exported.

PrimaryOnly 

Only primary headers and footers are exported at the beginning and end of each section.

It is hard to meaningfully output headers and footers to plain text because it is not paginated.

When this mode is used, only primary headers and footers are exported at the beginning and end of each section.

AllAtEnd 

All headers and footers are placed after all section bodies at the very end of a document.

@ Word2003
Optimize Aspose.Words behavior to match MS Word 2003 version.
@ RC4_128
RC4 encryption, key length of 128 bits.
String
@ Shape
A drawing object, such as an OfficeArt shape, image or an OLE object. A Shape node can contain Paragr...
@ Right
Align pages to the right.
@ Vml
Vector Markup Language is used to define the shape.
@ PageBreak
Explicit page break.
@ HeaderEven
Header for even numbered pages.
@ Grayscale
The pages of the document will be rendered as grayscale images.
@ Center
Center pages. This is the default value.
@ Dml
Drawing Markup Language is used to define the shape.
@ DrawingML
Aspose.Words ignores fall-back shape of DrawingML and renders DrawingML itself. This is the default m...
@ Epub
Saves the document in the IDPF EPUB format.
@ PrimaryOnly
Only primary headers and footers are exported at the beginning and end of each section.
static ASPOSECPP_SHARED_API DateTime get_Now()
@ RelativeOnly
Element sizes are exported only if they are specified in relative units in the document....
static ASPOSECPP_SHARED_API String ReadAllText(const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8())
@ AllAtEnd
All headers and footers are placed after all section bodies at the very end of a document.
@ EasternArabicIndic
Numerals used in Persian and Urdu: ۰۱۲۳۴۵۶۷۸۹. Unicode range U+06F0 - u+06F9.
@ NumberDefault
Default numbered list with 9 levels. Arabic numbering (1., 2., 3., ...) for the first level,...
@ Jpeg
Jpeg compression. Does not support transparency.
@ Format1bppIndexed
1 bit per pixel, Indexed.
ASPOSECPP_SHARED_API DateTime ToUniversalTime() const
@ DocumentAssembly
Allows assembling the document: inserting, rotating, or deleting pages and creating navigation elemen...
@ HeaderFirst
Header for the first page of the section.
@ SimpleCmyk
Aspose.Words coverts RGB images to CMYK color space using simple formula.
@ FloydSteinbergDithering
Specifies dithering using Floyd-Steinberg error diffusion method.
static ASPOSECPP_SHARED_API EncodingPtr get_UTF8()
@ Docx
Saves the document as an Office Open XML WordprocessingML Document (macro-free).
@ Centimeters
Specifies that the document content is saved using centimeters.
@ None
No headers and footers are exported.
@ DisallowAll
Disallows all operations on the PDF document. This is the default value.
@ Tiff
Renders a page or pages of the document and saves them into a single or multipage TIFF file.
@ ZoomFactor
Displays the page using the specified zoom factor.
@ HeaderPrimary
Primary header, also used for odd numbered pages.
@ PdfA1a
The output file will comply with the PDF/A-1a standard. This level includes all the requirements of P...
@ ModifyAnnotations
Allows adding or modifying text annotations. When using RC4 40-bit encryption, this option also allow...
@ Sha256
SHA-256 hash algorithm.
@ Iso29500_2008_Strict
ISO/IEC 29500:2008 Strict compliance level.
@ PdfA1b
The output file will comply with the PDF/A-1b standard. PDF/A-1b has the objective of ensuring reliab...
@ FooterEven
Footer for even numbered pages.
@ Xhtml
Saves the document in compliance with the XHTML 1.0 Transitional standard.
@ Html
Saves the document in the HTML format.
@ Left
Align pages to the left.
@ Svg
Metafiles are converted to vector SVG images.
static System::SharedPtr< Aspose::Words::CertificateHolder > Create(System::ArrayPtr< uint8_t > certBytes, System::SharedPtr< System::Security::SecureString > password)
Creates CertificateHolder object using byte array of PKCS12 store and its password.
@ None
No compression.
@ FooterPrimary
Primary footer, also used for odd numbered pages.
@ Ccitt3
Specifies the CCITT3 compression scheme.
@ UseOutlines
Document outline is visible. Note that if there're no outlines in the PDF document then outline navig...
@ Png
Renders a page of the document and saves it as a PNG file.
@ HeadingParagraph
The document is split into parts at a paragraph formatted using a heading style Heading 1,...
@ Image
OfficeMath is converted to HTML as image specified by <img> tag.
friend friend class Match
@ Grayscale
Rendering with colors in a range of gray shades from white to black.
@ EmbedNone
Aspose.Words do not embed any fonts.
@ BlackAndWhite
The pages of the document will be rendered as black and white images.
@ UsePlacedGlyphs
Text is rendered using curves. Note, text selection will not work if you use this option.
@ None
Headers and footers are not exported.
@ AsInlineText
Outputs all list labels as inline text.