Convert PDF to XML in PHP

Import PDF pages into presentation slides and save the result in PowerPoint XML Presentation format.

Convert PDF to XML in PHP

Aspose.Slides for PHP via Java can import PDF pages into presentation slides and save the resulting presentation in PowerPoint XML Presentation format.

The generated XML represents a presentation and preserves the imported pages as slide content; it does not extract the PDF’s logical structure into a generic XML schema.

Convert PDF to XML using PHP

Create a Presentation, remove its default slide, import the PDF pages with addFromPdf, and call save with SaveFormat::Xml.

PHP code for converting PDF into XML

$presentation = new Presentation();
try {
    $presentation->getSlides()->removeAt(0);
    $presentation->getSlides()->addFromPdf("document.pdf");

    $presentation->save("output.xml", SaveFormat::Xml);
} finally {
    $presentation->dispose();
}

How to convert PDF to XML using Aspose.Slides for PHP API

These are the steps to convert PDF to XML in PHP.

  1. Install Aspose.Slides for PHP via Java .

  2. Create a Presentation and remove its default slide.

  3. Import the PDF pages with addFromPdf.

  4. Call save with the output file path and SaveFormat::Xml.

Free Online Converter

Try our free Conversion app

Convert PDF To Other Supported Formats

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