Defines an SVG document
public interface ISvgDocument : IDisposable, ISerializable Public Interface ISvgDocumentInherits System.IDisposable, System.Runtime.Serialization.ISerializable
public interface ISvgDocument : IClosable @protocol ISvgDocument <NSObject> public interface ISvgDocument function Leadtools.ISvgDocument() System.IDisposable, System.Runtime.Serialization.ISerializable public interface class ISvgDocument : public System.IDisposable, System.Runtime.Serialization.ISerializable The SvgDocument class implements ISvgDocument. You should always cast ISvgDocument to SvgDocument to access the actual properties/methods of the SVG document class.
The interface is used by the LEADTOOLS framework to minimize dependencies between the various assemblies. For example, the Leadtools.Codecs.RasterCodecs.LoadSvg method (define in Leadtools.Codecs.dll) returns Leadtools.ISvgDocument (defined in Leadtools.dll) instead of Leadtools.Svg.SvgDocument (defined in Leadtools.Svg.dll). This way, Leadtools.Codecs.dll does not have a dependency on Leadtools.Svg.dll if SVG functionality is not required by your application.
For more information, refer to Working With SVG.
This example will load a PDF file as SVG and save it to disk
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;using Leadtools.ImageProcessing.Color;using Leadtools.Dicom;using Leadtools.Drawing;using Leadtools.Controls;using LeadtoolsExamples.Common;using Leadtools.Svg;public static void SvgDocumentExample(){// The source PDF filestring srcFileName = Path.Combine(ImagesPath.Path, "Leadtools.pdf");using (var codecs = new RasterCodecs()){// Set 300 as the default value for loading document filescodecs.Options.RasterizeDocument.Load.Resolution = 300;// get the number of pagesint pageCount = codecs.GetTotalPages(srcFileName);for (int pageNumber = 1; pageNumber <= pageCount; pageNumber++){// Load this page as SVG using default optionsusing (SvgDocument svgDocument = codecs.LoadSvg(srcFileName, pageNumber, null) as SvgDocument){// Save it to diskstring dstFileName = Path.Combine(ImagesPath.Path, string.Format("Page{0}.svg", pageNumber));svgDocument.SaveToFile(dstFileName, null);}}}}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.ImageProcessingImports Leadtools.ImageProcessing.CoreImports Leadtools.ImageProcessing.ColorImports Leadtools.ControlsImports Leadtools.DicomImports Leadtools.DrawingImports Leadtools.SvgPublic Shared Sub SvgDocumentExample()' The source PDF fileDim srcFileName As String = Path.Combine(Common.ImagesPath.Path, "Leadtools.pdf")Using codecs As New RasterCodecs()' Set 300 as the default value for loading document filescodecs.Options.RasterizeDocument.Load.Resolution = 300' get the number of pagesDim pageCount As Integer = codecs.GetTotalPages(srcFileName)For pageNumber As Integer = 1 To pageCount' Load this page as SVG using default optionsUsing svgDocument As SvgDocument = DirectCast(codecs.LoadSvg(srcFileName, pageNumber, Nothing), SvgDocument)' Save it to diskDim dstFileName As String = Path.Combine(Common.ImagesPath.Path, String.Format("Page{0}.svg", pageNumber))svgDocument.SaveToFile(dstFileName, Nothing)End UsingNextEnd UsingEnd Sub
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
