For more details, please visit Convert SVG to HTML on Linux in C#
Last active
December 22, 2021 17:00
-
-
Save aspose-com-gists/ea46e288dae0df3a13f127337bff3eba to your computer and use it in GitHub Desktop.
Convert SVG to HTML on Linux in C# .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize MemoryStream to save intermediary PDF file | |
MemoryStream stream = new MemoryStream(); | |
// Load input SVG file | |
using (Aspose.Svg.SVGDocument document = new SVGDocument("Sample.svg")) | |
{ | |
// Specify PdfRenderingOptions | |
PdfRenderingOptions options = new PdfRenderingOptions(); | |
options.PageSetup.Sizing = SizingType.ScaleContent; | |
using (PdfDevice device = new PdfDevice(options, stream)) | |
{ | |
// Render SVG to PDF file | |
document.RenderTo(device); | |
} | |
} | |
// Load the PDF document | |
Document pdfDocument = new Document(stream); | |
// Save SVG file contents to output HTML format | |
pdfDocument.Save("Sample.html", SaveFormat.Html); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment