To convert a PDF to XML, upload the PDF to an AI extraction tool like Lido to pull the data into a spreadsheet, export it to Excel, then save the file as XML.
In this tutorial, we will walk you through how to convert a PDF to XML using Lido. Simply follow the steps below.
The steps below work for invoices, purchase orders, bank statements, forms, and most other PDFs, including scanned copies.
Before you start, make sure you have the PDF you want to convert saved on your computer.
If you don't have a Lido account yet, you can create one for free here.
Once you're logged in, create a New File.

Select the Extract Data button at the top of the sheet.

Upload your file by dragging and dropping it into Lido, or click to browse. Lido will automatically analyze the file for you.

Enter the fields you want to pull from your PDF. For a bank statement, that might be Date, Amount, and Description. For an invoice, it might be Invoice Number, Vendor Name, and Total. You can also add extra instructions if you'd like (this is optional), such as extracting each line item as its own row.
Once done, click Process All Files.

Check the extracted data to make sure everything looks correct. You can edit any cell, rename columns, or remove data you don't need.

Click Export to Excel to download your data as a spreadsheet file.

Open the downloaded file in Excel. Go to File, then Save As, and choose XML Spreadsheet 2003 (*.xml) from the file type list.
Click Save. Your PDF data is now in an XML file. If your end goal is a database loaded with PDF data, a CSV file is often the simpler format.
There are a few other ways to convert a PDF to XML. Each one has trade-offs:
Adobe Acrobat Pro: Open the PDF, use the Export a PDF tool, and choose XML 1.0 under More Formats. This works for simple digital PDFs, but the XML only describes the page layout (paragraphs, tables), not the data itself, and it struggles with scanned files.
Python libraries: Developers can use libraries like pdfplumber to pull text and tables from a PDF, then write code to build the XML. This gives you full control, but it takes coding skills and doesn't work on scanned PDFs without extra setup.
Free online converters: Sites like Zamzar and Convertio convert a PDF to XML in a few clicks. They're fine for one-off files, but tables often break, and your file is uploaded to a third-party server, which is a risk for sensitive documents.
Now that you know how to convert a PDF to XML, you can turn your PDFs into structured data that other systems can read. If QuickBooks is one of those systems, compare PDF to QBO conversion tools as well.
Upload your PDF to Lido and choose the fields you want to extract. Lido pulls the data into a spreadsheet, which you can export to Excel and save as an XML file. No templates or coding required.
Yes. Lido includes built-in OCR that reads scanned and photographed documents. Upload the scan, and Lido extracts the same data as from a digital PDF, ready to export and save as XML.
Yes. Adobe Acrobat Pro can export a PDF as XML 1.0. However, the output describes the page layout rather than the data, so it is best for simple digital PDFs rather than invoices or forms you need to import into another system.
Yes. Free online converters and Python libraries can convert PDFs to XML at no cost, but they often break tables and struggle with scanned files. Lido offers 50 free pages so you can test AI extraction on your own documents.