Aspose::Words::Saving::HtmlSaveOptions::get_ResourceFolderAlias method

HtmlSaveOptions::get_ResourceFolderAlias method

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

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

Remarks

ResourceFolderAlias is the simplest way to specify how URIs for all resource files should be constructed. Same information can be specified for images and fonts separately via ImagesFolderAlias and FontsFolderAlias properties, respectively. However, there is no individual property for CSS.

ResourceFolderAlias has lower priority than FontsFolderAlias and ImagesFolderAlias. For example, if both ResourceFolderAlias and FontsFolderAlias are specified, fonts’ URIs will be constructed using FontsFolderAlias, while URIs of images and CSS will be constructed using ResourceFolderAlias.

If ResourceFolderAlias is empty, the ResourceFolder property value will be used to construct resource URIs.

If ResourceFolderAlias is set to ‘.’ (dot), resource URIs will contain file names only, without any path.

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