Disclaimer Im the founder of s a software solution specialised in transforming semi-structured documents (invoices purchase orders reports ) into structured data such as XML CSV JSON. As already mentioned by other there is unfortunately no easy way to convert PDF to XML files. This is simply because the PDF format doesn include any structuring tags like for example HTML does. A PDF file includes in most cases just a flat description of the visual representation of its content. Which means that there are no indicators which would allow you to easily identify hierarchical data and key data points. Some PDF files actually do have XML data stored in their metadata though. For example electronic PDF invoices might have all relevant key data inside the document metadata. But at the time of writing PDFs containing XML data are rather the exception. But there are still ways to convert PDF to XML s ! You have basically two different problems here to solve First you need to get hold of all and s. The way we do it at Docparser is to check if we can extract data and pipe the files through a OCR library if no was returned. In either case I would rmend to rely on Linuxmand line utilities. While you might also find a Python library the Linuxmands usually work much better in my experience. In case we need to handle scanned s as well as hidden returned by the OCR. Once you are sure that the PDF file contains data you can use the Linuxmand line tool PDFToText s with the option - layout. You should then have a representation of your PDF file which has (nearly) the same layout. Convert Extracted Text Into Structured Data This one is difficult to answer without knowing your specific use-case. Converting unstructured or semi-structured into a XML structure can be easy challenging or impossible. It really depends on the kind of data your are dealing with and how granular the output needs to be. At Docparser we developed a set of tools that can help you transform PDF documents such as invoices purchase orders delivery orders etc. into fine grained structured data objects without any coding. If this is something you would be interested in Ill be more than happy to ge you through our free trial.