This simple topic explains how to convert SVG to PDF in C#. It covers all the required information including the step-wise algorithm and an example code to create an SVG to PDF converter software in C#. Additionally, it also covers improvising the conversion process based on your requirements.
Steps to Export SVG to PDF in C#
- Configure the environment by adding Aspose.CAD for .NET using the NuGet package manager to convert SVG to PDF
- Access the source SVG file using the Image class instance
- Create an instance of the PdfOptions class and initialize the CadRasterizationOptions class object to set the page size
- Export the SVG file to PDF format and save it on the disk
The above steps entail the process to convert SVG files to PDF in C#. Initially, the source SVG file is accessed using an instance of the Image class, which is followed by setting the required PDF and rasterization options for the output PDF file. Finally, the loaded SVG file will be rendered as a PDF document on the disk.
Code to Export SVG to PDF in C#
This example code converts SVG to PDF in C#. The CadRasterizationOptions class is utilized to configure the page size of the output PDF document. Moreover, you can also set the watermark color, text rotation, watermark text, and other optional properties of the PdfOptions class as per your requirements.
This example has encompassed the details of converting an SVG to PDF in C#. If you are interested in PLT to PDF conversion, read the article on how to convert PLT to PDF in C#.