New to Telerik Document ProcessingStart a free 30-day trial

SVG FormSource

Updated on Feb 19, 2026
Minimum VersionQ3 2024

RadPdfProcessing provides support for SVG FormSource (vector graphics image format). The static FormSource.FromSvg method allows the possibility to insert a vector image in the PDF document. The following overloads are publicly available:

MethodDescription
FormSource.FromSvg(string xml)Creates a FormSource object from an SVG file provided as a xml.
FormSource.FromSvg(byte[] svgData)Creates a FormSource object from an SVG file provided as a byte[].
FormSource.FromSvg(Stream stream)Creates a FormSource object from an SVG file provided as a stream.

The following example shows how to insert an SVG image into a FormSource object using FixedContentEditor:

c#
string svgFilePath = "image.svg";
RadFixedDocument fixedDocument = new RadFixedDocument();
FixedContentEditor documentPageEditor = new FixedContentEditor(fixedDocument.Pages.AddPage());
int offset = 10;
documentPageEditor.Position.Translate(offset, offset);

FormSource svgHostForm = FormSource.FromSvg(File.ReadAllBytes(svgFilePath));
documentPageEditor.DrawForm(svgHostForm);
//draw the SVG FormSource with its original size

double aspectRatio = svgHostForm.Size.Width / svgHostForm.Size.Height;
//get the aspect ratio from the original SVG size
double desiredSVGWidth = 100;
double calculatedSVGHeight = desiredSVGWidth / aspectRatio;
documentPageEditor.Position.Translate(offset, svgHostForm.Size.Height + offset);
documentPageEditor.DrawForm(svgHostForm, new Size(desiredSVGWidth, calculatedSVGHeight));
//draw the SVG FormSource with desired width preserving the aspect ratio

PdfProcessing Insert SVG FormSource

See Also

In this article
See Also
Not finding the help you need?
Contact Support