This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Embed PDF document into XML file

Hello,

Is there a way to embed a pdf document (Base64) into a XML file?

Something like this.

<cbc:EmbeddedDocumentBinaryObject filename="Factuur.pdf " mimeCode="application/pdf">JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2........

André Oostendorp

  • 0

    SW Engineering(QA)  

    Although I am an OpenText employee, I am speaking for myself and not for OpenText.
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • 0

    Yes, the binary document is encoded in base64 and treated like other data.  XML is a character oriented standard, so binary cannot be embedded in an XML document without encoding into a character based encoding scheme, of which base64 is by far the most popular.

    However, many specifications, including those promulgated by OASIS, have an attachment mechanism which places a reference to the binary document in the XML, and then places the binary file data in the same stream, using identifiers.  I encountered this situation when adapting a Court Management System into a government-required LegalXML court document filing system.

    Are you trying to follow the specification for a specific system?

  • 0 in reply to 

    Hello,

    I got this working.

    First I create the XML using C$XML.

    I found a command line utiliy called Base64 to create the base64 string from the PDF file.

    After that I recreate the XML file and incorporate the base64 string (and the necessaryXML tags) into the XML.