cancel
Showing results for 
Search instead for 
Did you mean: 

Working with PDF Attachments

Former Member
0 Kudos

Hi Gurus,

We are using PI 7.3 in project. As per client's need, we need to parse the PDF files that comes as attachments in SOAP call. Also we need to merge PDFs if more than one is present in the attachments.

As mentioned in SAP sites, SAP Conversion agent is not available with PI 7.3 version. Since we don't have a lower version of PI, we can't install the agent on any other application server and use it.

For above reason, I have written a Java Mapping and that uses PDF Box api 1.7.1 to process the attachment files. This program runs fine in NWDS. but when I import the mappings into PI, message is getting hung up and processing is ending up incompletely. The PDF Box api is of 4 MB and I guess this is the reason the message is not getting processed.

Please suggest on this. Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Uma,

                Its difficult to point out exact reason of such error without actually seeing the code you wrote. You say its working fine in NWDS but not in PI server. Here are few alternatives you can try

1. Test the mapping with binary files or PDF file content as explained in this blog

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/07/08/can-we-test-binary-files-in-inter...

2. There is a difference in the way we provide input to java mapping code in PI than we do while testing code in NWDS. Thus please check again if java mapping code is able to accept the contents of file within it. Add trace object after each line of code.

3. Comment all lines of loop in the code and check using trace if program flow is working properly or not.

4. There is another API itext which you can use to process PDF files . You can have a look into this article

http://wiki.sdn.sap.com/wiki/display/XI/CODE+-+Create+a+PDF+File+via+the+iText+Library

Regards

Anupam