New to Telerik Document ProcessingStart a free 30-day trial

SVG FormSource

Updated on Jun 3, 2026
Minimum VersionQ3 2024

RadPdfProcessing supports SVG FormSource (vector graphics image format). The static FormSource.FromSvg method allows you to insert a vector image in the PDF document. The following overloads are available:

MethodDescription
FormSource.FromSvg(string xml)Creates a FormSource object from an SVG file provided as XML.
FormSource.FromSvg(byte[] svgData)Creates a FormSource object from an SVG file provided as a byte array.
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 by 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

RadPdfProcessing Insert SVG FormSource result

See Also

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