Aspose::Words::Saving::HtmlSaveOptions::get_ExportShapesAsSvg method
Contents
[
Hide
]HtmlSaveOptions::get_ExportShapesAsSvg method
Controls whether Shape nodes are converted to SVG images when saving to HTML, MHTML, EPUB or AZW3. Default value is false.
bool Aspose::Words::Saving::HtmlSaveOptions::get_ExportShapesAsSvg() const
Remarks
If this option is set to true, Shape nodes are exported as
Examples
Shows how to export text boxes as scalable vector graphics.
autodoc=MakeObject<Document>();autobuilder=MakeObject<DocumentBuilder>(doc);SharedPtr<Shape>textBox=builder->InsertShape(ShapeType::TextBox,100.0,60.0);builder->MoveTo(textBox->get_FirstParagraph());builder->Write(u"My text box");// When we save the document to HTML, we can pass a SaveOptions object// to determine how the saving operation will export text box shapes.// If we set the "ExportShapesAsSvg" flag to "true",// the save operation will convert shapes with text into SVG objects.// If we set the "ExportShapesAsSvg" flag to "false",// the save operation will convert shapes with text into images.autooptions=MakeObject<HtmlSaveOptions>();options->set_ExportShapesAsSvg(exportShapesAsSvg);doc->Save(ArtifactsDir+u"HtmlSaveOptions.ExportTextBox.html",options);StringoutDocContents=System::IO::File::ReadAllText(ArtifactsDir+u"HtmlSaveOptions.ExportTextBox.html");if(exportShapesAsSvg){ASSERT_TRUE(outDocContents.Contains(String(u"<span style=\"-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline\">")+u"<svg xmlns=\"http://www.w3.org/2000/svg\"xmlns:xlink=\"http://www.w3.org/1999/xlink\"version=\"1.1\"width=\"133\"height=\"80\">"));}else{ASSERT_TRUE(outDocContents.Contains(String(u"<p style=\"margin-top:0pt; margin-bottom:0pt\">")+u"<img src=\"HtmlSaveOptions.ExportTextBox.001.png\"width=\"136\"height=\"83\"alt=\"\""+u"style=\"-aw-left-pos:0pt; -aw-rel-hpos:column; -aw-rel-vpos:paragraph; -aw-top-pos:0pt; -aw-wrap-type:inline\"/>"+u"</p>"));}
See Also
- ClassHtmlSaveOptions
- NamespaceAspose::Words::Saving
- LibraryAspose.Words for C++