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 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();
}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.
How to convert PDF to XML using Aspose.Slides for PHP API
These are the steps to convert PDF to XML in PHP.
- Install Aspose.Slides for PHP via Java.
- Create a
Presentationand remove its default slide. - Import the PDF pages with
addFromPdf. - Call
savewith the output file path andSaveFormat::Xml.
Built with Aspose.Slides
Convert PDF to XML Online
The free Aspose.Slides Conversion app is built with Aspose.Slides for PHP via Java, the same API as the code above. Open it and see what the API can do with your own PDF files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides converts files before you write code.
- Upload PDF files and save them as XML.
- Download the result or convert more files.
Convert PDF To Other Supported Formats
You can also convert PDF and save to other file formats. See all supported formats below: