Aspose::Words::Saving::HtmlSaveOptions::get_ImagesFolderAlias method

HtmlSaveOptions::get_ImagesFolderAlias method

Specifies the name of the folder used to construct image URIs written into an HTML document. Default is an empty string.

System::String Aspose::Words::Saving::HtmlSaveOptions::get_ImagesFolderAlias() const

Remarks

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

If ImagesFolderAlias is not an empty string, then the image URI written to HTML will be ImagesFolderAlias + .

If ImagesFolderAlias is an empty string, then the image URI written to HTML will be ImagesFolder + .

If ImagesFolderAlias is set to ‘.’ (dot), then the image file name will be written to HTML without path regardless of other options.

Alternative way to specify the name of the folder to construct image URIs is to use ResourceFolderAlias.

Examples

Shows how to set folders and folder aliases for externally saved resources that Aspose.Words will create when saving a document to HTML.

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

auto options = MakeObject<HtmlSaveOptions>();
options->set_CssStyleSheetType(CssStyleSheetType::External);
options->set_ExportFontResources(true);
options->set_ImageResolution(72);
options->set_FontResourcesSubsettingSizeThreshold(0);
options->set_FontsFolder(ArtifactsDir + u"Fonts");
options->set_ImagesFolder(ArtifactsDir + u"Images");
options->set_ResourceFolder(ArtifactsDir + u"Resources");
options->set_FontsFolderAlias(u"http://example.com/fonts");
options->set_ImagesFolderAlias(u"http://example.com/images");
options->set_ResourceFolderAlias(u"http://example.com/resources");
options->set_ExportOriginalUrlForLinkedImages(true);

doc->Save(ArtifactsDir + u"HtmlSaveOptions.FolderAlias.html", options);

See Also