on 05-12-2016 12:37 PM
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>
</ns0:MT_PDF2XML>
---------------
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>
<Number>450005693</Number>
<Date>03/02/2001</Date>
<DeliveryDate>07/02/2001</DeliveryDate>
etc etc
Regards,
SP
Hi SP,
Better use some service from other Vendors like Ephisoft else you need to templatize your PO document and directly parse to XML using position. Any Java Program won't help you.
If you want you can use Tesseract Library for your Java Coding. But you will face lot of Challenges.
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SP,
In Java, there are couple of Library / API's available to convert PDF to XML like 'pdf2htmlEX'.
More information : Accessing File Formats (Wiki forum at Coderanch)
You can also check the Code mentioned in the below blog:
http://stackoverflow.com/questions/16936013/java-code-for-pdf-to-xml-conversion
Regards,
Nabendu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.