Aspose::Words::Saving::HtmlFixedSaveOptions::set_IdPrefix method

HtmlFixedSaveOptions::set_IdPrefix method

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

void Aspose::Words::Saving::HtmlFixedSaveOptions::set_IdPrefix(const System::String & value)

Remarks

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

Examples

Shows how to add a prefix that is prepended to all generated element IDs.

auto doc = System::MakeObject<Aspose::Words::Document>(System::String(get_MyDir() + u"Id prefix.docx"));

auto saveOptions = System::MakeObject<Aspose::Words::Saving::HtmlFixedSaveOptions>();
saveOptions->set_IdPrefix(u"pfx1_");

doc->Save(get_ArtifactsDir() + u"HtmlFixedSaveOptions.IdPrefix.html", saveOptions);

Exceptions

  • ArgumentException - The value does not meet the requirements specified above.

See Also