Class HtmlFixedSaveOptions

Class HtmlFixedSaveOptions

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.HtmlFixed format.

To learn more, visit the Specify Save Options documentation article.

public class HtmlFixedSaveOptions : FixedPageSaveOptions

Inheritance

objectSaveOptionsFixedPageSaveOptionsHtmlFixedSaveOptions

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

HtmlFixedSaveOptions()

public HtmlFixedSaveOptions()

Properties

CssClassNamesPrefix

Specifies prefix which is added to all class names in style.css file. Default value is “aw”.

public string CssClassNamesPrefix { get; set; }

Property Value

string

Encoding

Specifies the encoding to use when exporting to HTML. Default value is new UTF8Encoding(true) (UTF-8 with BOM).

public Encoding Encoding { get; set; }

Property Value

Encoding

ExportEmbeddedCss

Specifies whether the CSS (Cascading Style Sheet) should be embedded into Html document.

public bool ExportEmbeddedCss { get; set; }

Property Value

bool

ExportEmbeddedFonts

Specifies whether fonts should be embedded into Html document in Base64 format. Note setting this flag can significantly increase size of output Html file.

public bool ExportEmbeddedFonts { get; set; }

Property Value

bool

ExportEmbeddedImages

Specifies whether images should be embedded into Html document in Base64 format. Note setting this flag can significantly increase size of output Html file.

public bool ExportEmbeddedImages { get; set; }

Property Value

bool

ExportEmbeddedSvg

Specifies whether SVG resources should be embedded into Html document. Default value is true.

public bool ExportEmbeddedSvg { get; set; }

Property Value

bool

ExportFormFields

Gets or sets indication of whether form fields are exported as interactive items (as ‘input’ tag) rather than converted to text or graphics.

public bool ExportFormFields { get; set; }

Property Value

bool

FontFormat

Gets or sets Aspose.Words.Saving.ExportFontFormat used for font exporting. Default value is Aspose.Words.Saving.ExportFontFormat.Woff.

public ExportFontFormat FontFormat { get; set; }

Property Value

ExportFontFormat

IdPrefix

Specifies a prefix that is prepended to all generated element IDs in the output document. Default value is null and no prefix is prepended.

public string IdPrefix { get; set; }

Property Value

string

Remarks

If the prefix is specified, it can contain only letters, digits, underscores, and hyphens, and must start with a letter.

Exceptions

ArgumentException

The value does not meet the requirements specified above.

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 formating are concatenated. Note: The accuracy of the content display may be affected if this property is set to true.

Default is true.

public override bool OptimizeOutput { get; set; }

Property Value

bool

PageHorizontalAlignment

Specifies the horizontal alignment of pages in an HTML document. Default value is Aspose.Words.Saving.HtmlFixedPageHorizontalAlignment.Center.

public HtmlFixedPageHorizontalAlignment PageHorizontalAlignment { get; set; }

Property Value

HtmlFixedPageHorizontalAlignment

PageMargins

Specifies the margins around pages in an HTML document. The margins value is measured in points and should be equal to or greater than 0. Default value is 10 points.

public double PageMargins { get; set; }

Property Value

double

Remarks

Depends on the value of Aspose.Words.Saving.HtmlFixedSaveOptions.PageHorizontalAlignment property:

  • Defines top, bottom and left page margins if the value is Aspose.Words.Saving.HtmlFixedPageHorizontalAlignment.Left.
  • Defines top, bottom and right page margins if the value is Aspose.Words.Saving.HtmlFixedPageHorizontalAlignment.Right.
  • Defines top and bottom page margins if the value is Aspose.Words.Saving.HtmlFixedPageHorizontalAlignment.Center.

RemoveJavaScriptFromLinks

Specifies whether JavaScript will be removed from links. Default is false. If this option is enabled, all links containing JavaScript will be replaced with “javascript:void(0)”.

public bool RemoveJavaScriptFromLinks { get; set; }

Property Value

bool

ResourceSavingCallback

Allows to control how resources (images, fonts and css) are saved when a document is exported to fixed page Html format.

public IResourceSavingCallback ResourceSavingCallback { get; set; }

Property Value

IResourceSavingCallback

ResourcesFolder

Specifies the physical folder where resources (images, fonts, css) are saved when exporting a document to Html format. Default is null.

public string ResourcesFolder { get; set; }

Property Value

string

Remarks

Has effect only if Aspose.Words.Saving.HtmlFixedSaveOptions.ExportEmbeddedImages property is false.

When you save a Aspose.Words.Document in Html format, Aspose.Words needs to save all images embedded in the document as standalone files. Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolder allows you to specify where the images will be saved and Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolderAlias allows to specify how the image URIs will be constructed.

If you save a document into a file and provide a file name, Aspose.Words, by default, saves the images in the same folder where the document file is saved. Use Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolder to override this behavior.

If you save a document into a stream, Aspose.Words does not have a folder where to save the images, but still needs to save the images somewhere. In this case, you need to specify an accessible folder by using the Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolder property

Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolderAlias

ResourcesFolderAlias

Specifies the name of the folder used to construct image URIs written into an Html document. Default is null.

public string ResourcesFolderAlias { get; set; }

Property Value

string

Remarks

When you save a Aspose.Words.Document in Html format, Aspose.Words needs to save all images embedded in the document as standalone files. Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolder allows you to specify where the images will be saved and Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolderAlias allows to specify how the image URIs will be constructed.

Aspose.Words.Saving.HtmlFixedSaveOptions.ResourcesFolder

SaveFontFaceCssSeparately

Flag indicates whether “@font-face” CSS rules should be placed into a separate file “fontFaces.css” when a document is being saved with external stylesheet (that is, when Aspose.Words.Saving.HtmlFixedSaveOptions.ExportEmbeddedCss is false). Default value is false, all CSS rules are written into single file “styles.css”.

public bool SaveFontFaceCssSeparately { get; set; }

Property Value

bool

Remarks

Setting this property to true restores the old behavior (separate files) for compatibility with legacy code.

SaveFormat

Specifies the format in which the document will be saved if this save options object is used. Can only be Aspose.Words.SaveFormat.HtmlFixed.

public override SaveFormat SaveFormat { get; set; }

Property Value

SaveFormat

ShowPageBorder

Specifies whether border around pages should be shown. Default is true.

public bool ShowPageBorder { get; set; }

Property Value

bool

UseTargetMachineFonts

Flag indicates whether fonts from target machine must be used to display the document. If this flag is set to true, Aspose.Words.Saving.HtmlFixedSaveOptions.FontFormat and Aspose.Words.Saving.HtmlFixedSaveOptions.ExportEmbeddedFonts properties do not have effect, also Aspose.Words.Saving.HtmlFixedSaveOptions.ResourceSavingCallback is not fired for fonts. Default is false.

public bool UseTargetMachineFonts { get; set; }

Property Value

bool