Copy link to clipboard
Copied
Hello InDeign Gurus,
I am working on a proejct where I need to embed all the images as base64 encode mode. Here are the steps I have followed.
1. Convert the images into base64 code using "https://base64.guru/converter/encode/image"
2. Downlaoded the base64 version of the same image(PSD, PNG, JPG)
3. Embedded into IDML using <Contents><![CDATA[]]></Contents>
I am able to get perfect output for PSD,PNG and JPEG images. Images are embedded and able to preview the images in InDesign document.
But while doing the same for EPS(photoshop EPS), its not working as expected. InDesign quites while opening the EPS embedded IDML file.
Could you please help me to fix this one. Any one gone through this challenge earlier. Any helpful information much appricated.
Thank you in advance!
Kind reards
Arul
Hi Arul,
another method to get base64 code for any image or graphic you can place in InDesign:
Place and embed the image or graphic on an InDesign page.
Export the frame with the image to the IDMS snippet format.
Open the IDMS file in your editor and retrieve all the data between:
<Properties>
<Contents><![CDATA[
and
]]></Contents>
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Willi Adelberger,
Thank you so much for your inputs. This really helps.
Copy link to clipboard
Copied
Hi Arul,
not a great help, but could you check if this would work if you place and embed that particular EPS file in an InDesign document and then export or save an IDML file from it? If that will work and the EPS file has no flaw, then the method how to encode an image to base64 is not the right one for that particular EPS file from PhotoShop.
In principle your method should work. I tested it. All on Windows 10.
Saved an EPS file from a sample image in PhotoShop.
Placed and embeded the EPS file on an InDesign page.
Exported to IDML.
On the other hand I encoded the same EPS file to base64 using the service that you linked to.
Copied the result to the clipboard.
Opened the IDML file with 7-zip on my Windows machine and opened the Spread_UCF.xml file in my Editor app, exchanged all the image data from the embeded EPS with the data from the clipboard, saved and updated the IDML with 7-zip.
Finally opened the edited IDML file with InDesign 2023 version 18.1.
No issue. InDesign opened the IDML without any flaws. No crash.
Can you be more specific about your version of InDesign that is crashing?
What's the creator version of the PhotoShop EPS?
What's the operating system you are using? And finally, what's the Editor that you are using to edit or to write your IDML contents?
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi Uwe,
Thank you so much for your inputs. This really helps. I use indesign version 2022 and EPS cretaed version 2022. I understand the softwre versions needs to be comptabile. I will check.
Copy link to clipboard
Copied
Hi @hm_arul ,
not necessarilly. The EPS could come from an older version of PhotoShop as well.
But this is an interesting point. Could you share your EPS file that is not working?
There are various ways to save an EPS from PhotoShop. Perhaps some kind of it will not work? Unlikely, but one should test it.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
Hi Arul,
another method to get base64 code for any image or graphic you can place in InDesign:
Place and embed the image or graphic on an InDesign page.
Export the frame with the image to the IDMS snippet format.
Open the IDMS file in your editor and retrieve all the data between:
<Properties>
<Contents><![CDATA[
and
]]></Contents>
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
A third way to get the base64 code for an image is… ExtendScript! More precisely, by including IdExtenso's (core) framework you have the b64 converter already available in the String object:
// IdExtenso entry point
#include 'path/to/$$.jsxinc'
$$.load();
var b64 = $$.File.readBinary("path/to/my/image.jpg").toBase64(true);
$$.unload();
Or, if you want the toBase64() method alone, here is how it is implemented in IdExtenso:
Best,
Marc
Copy link to clipboard
Copied
On a Mac, you could call out to the system,
/usr/bin/base64
P.