cancel
Showing results for 
Search instead for 
Did you mean: 

query on processing a PDF file using Java mapping

Former Member
0 Kudos

Hi All,

i am trying to process a XML and PDF file using Java mapping, it is successful in XML but unable to do for PDF.

below is the code i am using... can any one guide me how to process PDF's..

byte byte1 = 0;

java.io.ByteArrayOutputStream bos = (ByteArrayOutputStream)outputstream;

while((byte1=(byte)inputstream.read())!=-1){

bos.write(byte1);

bos.close();

Thank You,

Madhav

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Madhav,

I think instead of going with JAVA mapping you can write a custom adapter module for it.

Ref: /people/sap.user72/blog/2005/07/31/xi-read-data-from-pdf-file-in-sender-adapter

Also check :

/people/shabarish.vijayakumar/blog/2009/05/17/trouble-writing-out-a-pdf-in-xipi

Thanks,

Edited by: Hareenkumar on Dec 21, 2010 11:12 AM

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi All,

it is successfull, i am able to process both PDF and XML files using below code....

byte[] data = new byte[512];

while(inputstream.read(data)>=0) {

outputstream.write(data);

}

outputstream.close();

Thank You,

Madhav

stefan_grube
Active Contributor
0 Kudos

> but unable to do for PDF.

What does this mean? Do you get an error, a wrong result, an empty result?

"unable to do" is not very helpful.