Saves this SvgDocument to a stream.
public void SaveToStream(Stream stream,Leadtools.Svg.SvgSaveOptions options)
Public Sub SaveToStream( _ByVal stream As Stream, _ByVal options As Leadtools.Svg.SvgSaveOptions _)
- (BOOL)saveToStream:(LTLeadStream *)streamoptions:(nullable LTSvgSaveOptions *)optionserror:(NSError **)error
public:void SaveToStream(Stream^ stream,Leadtools.Svg.SvgSaveOptions^ options)
stream
Output stream.
options
Save option. Can be null.
This method will save this SvgDocument to the output stream as a standard SVG document. Use Version to control the SVG version used.
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.DrawingImports Leadtools.Forms.DocumentWritersImports Leadtools.SvgPublic Shared Sub SvgToStreamExample()' Assume the SVG file is located hereDim srcFileName As String = Path.Combine(Common.ImagesPath.Path, "Page1.svg")Dim stream As New MemoryStream()' Load the SVG from fileUsing document As SvgDocument = SvgDocument.LoadFromFile(srcFileName, Nothing)ShowSvgProperties("Original", document)' Set the version and save it to a streamdocument.Version = SvgVersion.v10document.SaveToStream(stream, Nothing)stream.Position = 0End Using' Load the SVG from stream and show its propertiesUsing document As SvgDocument = SvgDocument.LoadFromStream(stream, Nothing)ShowSvgProperties("Loaded from stream", document)End Usingstream.Dispose()End SubPrivate Shared Sub ShowSvgProperties(message As String, document As SvgDocument)' Prepare itIf Not document.IsFlat Thendocument.Flat(Nothing)End IfIf Not document.Bounds.IsValid Thendocument.CalculateBounds(False)End If' Show its propertiesConsole.WriteLine(message)Console.WriteLine(" Version: " + document.Version.ToString())Console.WriteLine(" Bounds: " + document.Bounds.Bounds.ToString())Console.WriteLine(" Resolution: " + document.Bounds.Resolution.ToString())End Sub
using Leadtools;using Leadtools.Codecs;using Leadtools.Drawing;using Leadtools.Forms.DocumentWriters;using Leadtools.Svg;public void SvgToStreamExample(){// Assume the SVG file is located herestring srcFileName = Path.Combine(ImagesPath.Path, "Page1.svg");Stream stream = new MemoryStream();// Load the SVG from fileusing (SvgDocument document = SvgDocument.LoadFromFile(srcFileName, null)){ShowSvgProperties("Original", document);// Set the version and save it to a streamdocument.Version = SvgVersion.v10;document.SaveToStream(stream, null);stream.Position = 0;}// Load the SVG from stream and show its propertiesusing (SvgDocument document = SvgDocument.LoadFromStream(stream, null)){ShowSvgProperties("Loaded from stream", document);}stream.Dispose();}private static void ShowSvgProperties(string message, SvgDocument document){// Prepare itif (!document.IsFlat)document.Flat(null);if (!document.Bounds.IsValid)document.CalculateBounds(false);// Show its propertiesConsole.WriteLine(message);Console.WriteLine(" Version: " + document.Version);Console.WriteLine(" Bounds: " + document.Bounds.Bounds);Console.WriteLine(" Resolution: " + document.Bounds.Resolution);}
|
Products |
Support |
Feedback: SaveToStream Method - Leadtools.Svg |
Introduction |
Help Version 19.0.2017.3.21
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.