I have a bunch of XML invoice files that I need to send to my accountant this afternoon, and she only accepts PDFs. I tried opening them in my browser to print to PDF, but it just shows all the raw code tags instead of a clean document. Is there a fast way to turn these XML files into readable PDFs on a Windows PC?
That is annoying, honestly the raw tags mean the XML has no stylesheet, so browser printing will not look right. If these are invoices, I would open one in Excel, import it as an XML table, and then use Save As PDF. To be fair, if you need the invoice layout, ask the sender for an XSL template, because plain XML will not become a clean form by itself.
Raw code view means your XML files have no stylesheet attached, so the browser can’t format them. Quick workaround:
- Open the XML in Excel (File > Open, choose “As an XML table”). It parses the tags into neat rows.
- Save As > PDF.
If it’s a big batch, CloudConvert does xml to pdf with multiple files at once, might be faster than doing each by hand.
If the XML came with an XSL or XSLT stylesheet, keep it in the same folder, open the XML in Edge, then press Ctrl+P and choose “Microsoft Print to PDF”. If it still shows tags, it has no layout attached, so use the invoice sender’s viewer or an XML invoice converter instead, and don’t just rename the file to .pdf.
XML needs a stylesheet or invoice template before it can look like a document. I would open the invoices in the accounting program that created them and use its Print option with “Microsoft Print to PDF”; honestly, that is usually fastest and keeps the layout readable. Avoid printing the raw XML from the browser, since the tags are the data, not the formatted invoice.
@cameron2002 That Excel trick is brilliant because it organizes everything! Just check the page layot before saving, as columns can spill over and you might need to adjust the margins. Do you usually use the fit to page setting when doing this on your device?
@rando72836 Yes, I always tick fit to page, otherwise a wide invoice runs off the edge. Set it to fit all columns on one page, then check the preview before saving. I also keep a backup of the original XML files, just in case the accountant needs them later.
If it’s invoice XML there’s usually a style sheet (XSLT) that formats it, that’s why your browser just shows raw tags without it. Check if your invoicing software has an “export as PDF” option instead, way less of a headache than wrestling with raw XML.