'''' 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 '' Use GcSvgDocument to render a few images used as illustrations'' in the SVG spec.PublicClassSvgSpecArtFunctionCreatePDF(ByVal stream AsStream) AsInteger'' Load images from resources:Dim fnames = NewList(OfString)() From {"dash-path.svg", "opacity.svg", "paths.svg", "shadowstyle.svg", "units.svg"}Dim images = NewList(Of (String, GcSvgDocument))()ForEach f In fnames images.Add((f, GcSvgDocument.FromFile(Path.Combine("Resources", "SvgSpecArt", f))))Next ConstmarginAsSingle = 36ConstgapyAsSingle = 18Dim ip = NewPointF(margin, margin) '' Render the images:Dim doc = NewGcPdfDocument()Dim g = doc.NewPage().GraphicsFor i = 0To images.Count - 1Dim svg = images(i).Item2Dim s = svg.GetIntrinsicSize(SvgLengthUnits.Points) g.DrawSvg(svg, ip) ip.Y += s.Height + gapyNext '' Done: doc.Save(stream)'' Dispose images after saving the PDF: images.ForEach(Sub(t_) t_.Item2.Dispose())Return doc.Pages.CountEndFunctionEndClass