Skip to Content
May 12, 2016 at 11:37 AM

PDF to XML conversion


Hi ,

Is there any way to convert pdf document to xml in SAP PI.

I have checked SCN for suggesion and found one java mapping code which actually writes all the data of pdf (not in sequence.. means sometimes writing middle column first and sometimes last column first etc.. ) to xml file in a single string not as xml tags.

My example pdf is attached here.

Ex output:


<?xml version="1.0" encoding="UTF-8"?>

-<ns0:MT_PDF2XML xmlns:ns0="http://pdf2xml">

<Record>Page 1 Purchase order ABC Enterprises ABC Road Alpine Number: Date: Delivery date: 4500005693 03/02/2001 07/02/2001 NumberArticleDescriptionPriceQuantityTaxAmount00010R-5000ABC red 250 gr10.0111.016 1110.0 00011R-3456ABC magic 500 gr1000.01.016 1000.0Tax: Total: 337.6 2447.6 </Record>



I can take data from here and use substring function to get appropriate outout, but is there a way to get the tags and values in that tags.

Expected output:


<?xml version="1.0" encoding="UTF-8"?>

-<ns0:MT_PDF2XML xmlns:ns0="http://pdf2xml">

<Name>Purchase Order</Name>

<Address>ABC enterprises,ABC Road, Alpine</Address>




etc etc




pdf.JPG (50.0 kB)