i am want to read pdf file from disk and attach it to one of the xml profile element which sending that xml to thirdparty webserviceif anyone has done this,please reply
I have a similar requirement and I followed the steps you have listed. I was having problem indexing binary data (pdf) so I used Data Process shape to encode in Base64 format. However after decoding, the pdf retrieved seems to be corrupt. Any pointers ?
I am using this code for my file to work
I am using script in map function and having two outputs -filename and encoded data and file name as input,
byte filebytes = new File(‘\\\\<pathtoserver>\\<foldername>\\’+filename+’.pdf’).readBytes()
String encoded = filebytes.encodeBase64().toString()
name = filename+”.pdf”;
filecon = encoded ;
Regarding the doc cache indexing, I would use a dynamic document property vs. a profile element (because a PDF has not profile type)...is that what you tried?
Regarding corrupt, if I understood you correctly you read in a PDF from disk, base64 encoded, then base64 decoded, wrote to disk as *.pdf but you couldn't open the PDF normally? I'm pretty sure I've done that before without issue....
Sorry, I was not clear in my previous comment.
I am receiving PDF as a SOAP attachment. The overall requirement is to insert SOAP request fields and attachment to a database table.
After retrieving attachment, I am encoding it in Base64 (using Data Process shape) and storing it in a document cache with index being a static value like "1".. In the subsequent branch there is a logic to insert the data to database table.
For testing the correctness, I added a branch where I retrieved encoded file and decode it using Data Process shape, then I write the file to disk. But for some reason acrobat is unable to open this file.
Sunil Bagul - Thanks for your feedback.
Retrieving data ...