Creates an SvgDocument object from a stream containing SVG data.
public static Leadtools.Svg.SvgDocument LoadFromStream(Stream stream,Leadtools.Svg.SvgLoadOptions options)
Public Shared Function LoadFromStream( _ByVal stream As Stream, _ByVal options As Leadtools.Svg.SvgLoadOptions _) As Leadtools.Svg.SvgDocument
- (nullable instancetype)initWithStream:(LTLeadStream *)streamoptions:(nullable LTSvgLoadOptions *)optionserror:(NSError **)error
public:static Leadtools.Svg.SvgDocument^ LoadFromStream(Stream^ stream,Leadtools.Svg.SvgLoadOptions^ options)
stream
The stream containing SVG data
options
Options to use during load. If this parameter is null, then a default SvgLoadOptions object will be used.
The SvgDocument object this method creates.
To get and set information about a document's bounds and resolution, refer to SVG Size, Bounds and Flat.
This example will load a SVG file from a web stream and show its properties
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.DrawingImports Leadtools.Forms.DocumentWritersImports Leadtools.SvgPublic Shared Sub SvgLoadFromStreamExample()' Assume the SVG files are located hereDim addressTemplate As String = "http://localhost/images/examples/page1.svg"' Get a stream to itDim request As WebRequest = WebRequest.Create(New Uri(addressTemplate))Using response As WebResponse = request.GetResponse()Dim stream As Stream = response.GetResponseStream()' Load itUsing document As SvgDocument = SvgDocument.LoadFromStream(stream, Nothing)' Prepare itIf Not document.IsFlat Thendocument.Flat(Nothing)End IfIf Not document.Bounds.IsValid Thendocument.CalculateBounds(False)End If' Show its propertiesConsole.WriteLine("Bounds: " + document.Bounds.Bounds.ToString())Console.WriteLine("Resolution: " + document.Bounds.Resolution.ToString())End UsingEnd UsingEnd Sub
using Leadtools;using Leadtools.Codecs;using Leadtools.Drawing;using Leadtools.Forms.DocumentWriters;using Leadtools.Svg;public void SvgLoadFromStreamExample(){// Assume the SVG files are located herestring addressTemplate = @"http://localhost/images/examples/page1.svg";// Get a stream to itWebRequest request = WebRequest.Create(new Uri(addressTemplate));using (WebResponse response = request.GetResponse()){Stream stream = response.GetResponseStream();// Load itusing (SvgDocument document = SvgDocument.LoadFromStream(stream, null)){// Prepare itif (!document.IsFlat)document.Flat(null);if (!document.Bounds.IsValid)document.CalculateBounds(false);// Show its propertiesConsole.WriteLine("Bounds: " + document.Bounds.Bounds);Console.WriteLine("Resolution: " + document.Bounds.Resolution);}}}
|
Products |
Support |
Feedback: LoadFromStream 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.