'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystemImportsSystem.IOImportsSystem.DrawingImportsSystem.LinqImportsSystem.Collections.GenericImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Svg '' This short sample shows how to measure and render an SVG image.'' Note that when an SVG is rendered on GcPdfGraphics, it is NOT rasterized,'' so the image quality is preserved if the SVG is scaled up or down.PublicClassRenderSvgFunctionCreatePDF(ByVal stream AsStream) AsInteger'' Load the SVG:Dim svgPath = Path.Combine("Resources", "SvgClipArt", "Smiling-Girl.svg")Using svg = GcSvgDocument.FromFile(svgPath)'' Measure and render the image:Dim doc = NewGcPdfDocument()Dim g = doc.NewPage().GraphicsDim pt = NewPointF(g.Resolution, g.Resolution)Dim rc = NewRectangleF(pt, svg.GetIntrinsicSize(SvgLengthUnits.Points))'' Draw the SVG and a border around it: g.DrawSvg(svg, pt) g.DrawRectangle(rc, Color.DarkGray) '' Done: doc.Save(stream)Return doc.Pages.CountEndUsingEndFunctionEndClass