Skip to main content

Embedded Document BinaryObject

  • March 13, 2019
  • 3 replies
  • 4 views

Forum|alt.badge.img

Hello

I need to generate a xml file with a pdf file content included

an example I have :

----------------------------------------------------

<cac:Attachment>

<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf">UEsDBBQAAAAIAOxTskgQN   ......

</cbc:EmbeddedDocumentBinaryObject>

----------------------------------------------------

Wich type of field, length do I have to use , and  for loading the pdf file into this field : fileload/raw ?


Dominique


3 replies

  • March 13, 2019

Hello

I need to generate a xml file with a pdf file content included

an example I have :

----------------------------------------------------

<cac:Attachment>

<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf">UEsDBBQAAAAIAOxTskgQN   ......

</cbc:EmbeddedDocumentBinaryObject>

----------------------------------------------------

Wich type of field, length do I have to use , and  for loading the pdf file into this field : fileload/raw ?


Dominique


https://stackoverflow.com/questions/4517277/send-pdf-file-in-xml-message

suggests:

You can transform the PDF file to Base64 Binary and wrap this into a container Element with type xs:base64Binary.


A more detailed post you can find in

https://www.experts-exchange.com/questions/24902224/Attach-PDF-File-to-an-XML-File.html


Forum|alt.badge.img
  • Participating Frequently
  • March 14, 2019

Hello

I need to generate a xml file with a pdf file content included

an example I have :

----------------------------------------------------

<cac:Attachment>

<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf">UEsDBBQAAAAIAOxTskgQN   ......

</cbc:EmbeddedDocumentBinaryObject>

----------------------------------------------------

Wich type of field, length do I have to use , and  for loading the pdf file into this field : fileload/raw ?


Dominique


Hi,

ULI is right, you must encode raw data in BASE64 .

if I remember correctly we do something like this :

Variables

raw content

endvariables

lfileload/raw pdffile,content

stringfield.ENTITY=$encode("BASE64",pdfile)

xmlsave "ENTITY","DTD"

or

UXMLWRITER.CHARACTERS(stringfield)

Gilles.


Forum|alt.badge.img
  • Author
  • Participating Frequently
  • March 14, 2019

Hello

I need to generate a xml file with a pdf file content included

an example I have :

----------------------------------------------------

<cac:Attachment>

<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf">UEsDBBQAAAAIAOxTskgQN   ......

</cbc:EmbeddedDocumentBinaryObject>

----------------------------------------------------

Wich type of field, length do I have to use , and  for loading the pdf file into this field : fileload/raw ?


Dominique


Thanks for answers

saved me time


Dominique