• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

PSD, EPS, PNG, JPEG base64 conversion and embedding into IDML

Explorer ,
Jan 26, 2023 Jan 26, 2023

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

TOPICS
Import and export , Print , Publish online , Scripting , SDK

Views

2.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 26, 2023 Jan 26, 2023

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 )

Votes

Translate

Translate
Community Expert ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

  1. Embedding images into InDesign is not a good idea as this is the main cause of corrupted files.
  2. Are you aware that EPS is a file type from last millenium. I recommend to not use it in modern times. Use PDF/X-4 instead.
  3. PNG is a file type not for print projects, use PSD or PDP instead.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

Hi Willi Adelberger,

Thank you so much for your inputs. This really helps.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2023 Jan 26, 2023

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 )

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2023 Jan 27, 2023

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2023 Jan 26, 2023

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 )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 27, 2023 Jan 27, 2023

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:

https://github.com/indiscripts/IdExtenso/blob/1e9b015a21e6e2bea85f2b6d2d654503be2870d2/core/Ext/%24%...

 

Best,

Marc

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 27, 2023 Jan 27, 2023

Copy link to clipboard

Copied

LATEST

On a Mac, you could call out to the system, 

/usr/bin/base64

 

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines