I am currently working on the following process :
pooling a directory containing pdf, then encapsulate each pdf into an xml file .
To encapsulate the pdf into the xml document , I encode its bytes content into a base 64 string.
Unfortunately, this base64 encoding cause the corruption of the pdf .
Description of my process :
pub.file:getFile (load as bytes, encoding=UTF-8 )
pub.string:base64Encode
For the tests, I have used pub.string:base64Decode in order to compare bytes before/after. And the bytes after process are not equals to the original ones.
Thanks for your answers. I don’t know how to share the bytes( ?? )
Anyway : I progressed since this morning :
My pdf contain an image and after processing (I send the xml capsule and a distant service extract the pdf)
The extract pdf can be opened but generate an error in ACreader. The image is no more visible.
After opening the pdf editor, it appear that there is a stream included in the pdf file (pretty sure it is the image)
This is the part which is corrupted by the base64encode.
I tried a javaservice using org.apache.commons.codec.binary.Base64 : Base64.encodeBase64(bytes)
Same result. I am not sure that is is possible to do what I want as the pdf is a combination of bytes and stream.
What I don’t understand anyway, is that I can send me properly the pdf using the pub.client.SMTP service passing the bytes into attachments and specifying encoding = “base64”