Creating the XML Import File

Hi again and regards from the sunny Hamburg,

I want to create a XML Import File, and everything works fine, i have only one issue, how do i get the GalleyPDF embed into xml.

I try this:
<##embed encoding=“base64” filename=“my_file.pdf” mime_type=“application/pdf”>PGxpPjxCPlc8Zm9ukjfdaSD…(and so on)<##/embed>

, but i don’t get the code of the GalleyPDF in base64, in my case it shows like this without code:

<##embed encoding=“base64” filename=“my_file.pdf” mime_type=“application/pdf”/><##/embed>

I know there is a plugin that makes that for me, but for my special case i could not use.

Thanks in advance,
Peter

1 Like

Hi @pitertennis_paco

If you create the XML import file by yourself, you can use the URL of the galley instead of the embed code, like this:
<galley> <label>PDF</label> <file> <href mime_type="application/pdf" src="http://URL_to_the_PDF_file.pdf"/> </file> </galley>
The PDF file has to be then accessible on that URL – the system will then get the file from the URL and import it in.

When article are exported from the system, then they are base64-encoded exported in the file.

You could also program just a small function to give you the base64 encoding of a file, run the function for each PDF and import/copy the code in your XML import file, but if you could handle it with the URLs it is much easier.

Best,
Bozana

2 Likes

thank u very much that was it !!!

Can you please share your file or direct me where I can find a sample?

Hi @Taz

What OJS version are you using?

Best,
Bozana

I am using OJS 3.1.1