Bug #790

XMP embedding corrupts CorelDRAW EPS files

Added by Volker Grabsch about 10 years ago. Updated over 9 years ago.

image format
Target version:
Start date:
30 Sep 2011
Due date:
% Done:


Estimated time:


When XMP is embedded into an EPS file generated by CorelDRAW, the resulting EPS file is corrupt and won't open. As of Exiv2 0.22, the only workaround is removing the XMP via "exiv2 -dx".

This issue exists with all CorelDRAW versions from 11 to X5, and possibly also with older versions of CorelDRAW. The resulting file can't be opened with any application, because the problem happens at the level of PostScript code.

Note that this issue is very different from the issue with Illustrator-8 EPS files, where only one application (Illustrator) wasn't able to open the modified EPS file, but all other applications worked perfectly fine with it.

The problem is caused by CorelDRAW's somewhat strange interpretation of the DSC specification. Usually, the PostScript code after %%EndPageSetup leaves the stack in the same state as it started. However, in CorelDRAW's code the first effective PostScript command is "restore" (called by "@rs" called by "@rax"). This works only well if the last command of PageSetup was "@sv" (which calls "save"). However, this is exactly where our XMP embedding code is inserted, in conformance with the XMP specification. So the "restore" undoes some definition of our XMP embedding which leads to an "undefined" error later in the second part of the XMP embedding code (at %%PageTrailer).

In simpler words, the CorelDRAW EPS code expects the last command of %%PageSetup to be "@sv", otherwise it won't work properly.

I think we can improve our embedding code to add some workaround for the special case of CorelDRAW EPS files.

Associated revisions

Revision 2619 (diff)
Added by Volker Grabsch about 10 years ago

#790: Added workaround for EPS files generated by CorelDRAW



Updated by Volker Grabsch about 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

I fixed this issue and added some test EPS files generated by CorelDRAW. (r2619)


Updated by Andreas Huggel over 9 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF