Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active March 16, 2022 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/1474dbdb3fef6b095c859ae4e000420b to your computer and use it in GitHub Desktop.
Save aspose-com-gists/1474dbdb3fef6b095c859ae4e000420b to your computer and use it in GitHub Desktop.
Convert SVG to Word DOCX Programmatically in C# .NET
// Initialize an SVG document from the file
SVGDocument document = new SVGDocument("sample.svg");
// Initialize DocSaveOptions to set up different properties
DocSaveOptions options = new DocSaveOptions();
options.DocumentFormat = DocumentFormat.DOCX;
options.PageSetup.AnyPage = new Page(new Size(500, 500), new Margin(30, 10, 10, 10));
// Convert SVG to DOCX
Converter.ConvertSVG(document, options, "sample_output.docx");
// Initialize an SVG document from the file
SVGDocument document = new SVGDocument("sample.svg");
// Convert SVG to Word DOCX
Converter.ConvertSVG(document, new DocSaveOptions(), "sample_output.docx");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment