I have sample content in the link here. it is plain text. How do any solutions to convert this text content to original pdf file? (This content I got from MTOM service)
I got so far from this source
multipart/mixed
that contain both json and binary content as text.
--uuid:dba94a0e-2d99-4675-9781-2a736995bdc8
Content-Type: application/json;charset=UTF-8
Content-Transfer-Encoding: binary
Content-ID: <jsonInfos>
{"messages":[{"id":"0","type":"INFOS","messageContent":"La requête a été traitée avec succès","replacementValues":[]}]}
--uuid:dba94a0e-2d99-4675-9781-2a736995bdc8
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <label>
%PDF-1.3
%����
12 0 obj
<<
/BitsPerComponent 8
/ColorSpace /DeviceRGB
/Filter [/FlateDecode /DCTDecode]
/Height 80
/Length 2486
/Name /Obj0
/Subtype /Image
/Type /XObject
/Width 119
>>
stream
x���{<��ǟ1f��$1rY�{�QY �a�Les�-jܧ��Qm��R4!wi&�Y�$32��h�1�f�Sg�9�:����y^�?���|���|�5�lr���`0p@:�N)�@"d�H�Bʡ7����h���6��lݪ�������a5t���j��k`h��Hg� �K}��S
....
....
....
startxref
101943
%%EOF
--uuid:dba94a0e-2d99-4675-9781-2a736995bdc8--
I tried in python:
with open('tmp.txt', 'r') as tmp:
with open('sample.pdf', 'wb') as sample:
sample.write(tmp.read().encode('utf-8'))
.pdf
.multipart/mixed
from the service. Do any package work and extract data from MTOM payload?