Convert PDF to SVG in C++
Convert PDF files to SVG using Aspose.Slides for C++ without Adobe Acrobat or Microsoft PowerPoint.
Convert PDF to SVG in C++
Aspose.Slides for C++ is a presentation processing API that can import PDF pages into slides and export those slides as SVG files. Using Aspose.Slides for C++, developers can convert PDF files to SVG with just a few lines of C++ code.
Aspose.Slides for C++ can convert PDF content to SVG and other presentation-related formats.
Convert PDF to SVG Using C++
To convert PDF to SVG, create a Presentation, remove the default slide, import the PDF pages, and write each slide to an SVG file.
C++ code for converting PDF into SVG
auto presentation = MakeObject<Presentation>();
presentation->get_Slides()->RemoveAt(0);
presentation->get_Slides()->AddFromPdf(u"input.pdf");
auto slideCount = presentation->get_Slides()->get_Count();
for (int slideIndex = 0; slideIndex < slideCount; slideIndex++)
{
auto fileName = String::Format(u"slide_{0}.svg", slideIndex);
auto fileStream = MakeObject<FileStream>(fileName, FileMode::Create, FileAccess::Write);
auto currentSlide = presentation->get_Slide(slideIndex);
currentSlide->WriteAsSvg(fileStream);
fileStream->Dispose();
}
presentation->Dispose();
How to convert PDF to SVG using Aspose.Slides for C++ API
These are the steps to convert PDF to SVG in C++.
Install Aspose.Slides for C++ .
Add a library reference to your C++ project.
Remove the default slide and import the source PDF file into the Presentation object.
Write each slide to an SVG file.
Free Online Converter
Convert presentations and slides online.
Convert PDF to Other Supported Formats
You can also convert PDF files and save them to other file formats. See all supported formats below.