Convert PDF to SVG in Java

Convert PDF files to SVG with Aspose.Slides for Java without Adobe Acrobat.

Convert PDF to SVG in Java

Aspose.Slides for Java lets you import PDF files into a presentation and export slides as SVG images. With this Java API, you can convert PDF content without Adobe Acrobat.

Convert PDF to SVG using Java

To convert PDF to SVG, create a Presentation, import the source file with ISlideCollection.addFromPdf, and export each imported slide with ISlide.writeAsSvg.

Java code for converting PDF into SVG

Presentation presentation = new Presentation();
try {
    presentation.getSlides().addFromPdf("input.pdf");
    for (ISlide slide : presentation.getSlides()) {
        FileOutputStream outputStream = new FileOutputStream("slide_" + slide.getSlideNumber() + ".svg");
        try {
            slide.writeAsSvg(outputStream);
        } finally {
            outputStream.close();
        }
    }
} finally {
    presentation.dispose();
}

How to convert PDF to SVG using Aspose.Slides for Java API

These are the steps to convert PDF to SVG in Java.

  1. Install Aspose.Slides for Java .

  2. Add a library reference (import the library) to your Java project.

  3. Open the source PDF file in Java.

  4. Save each slide as an SVG file.

Free Online Converter

Convert presentations and slides online.

Convert PDF To Other Supported Formats

You can also convert PDF and save to other file formats. See all supported formats below