Adobe Illustrator (.ai) files

Oxygen general issues.
KingKong
Posts: 1
Joined: Tue Mar 17, 2026 12:18 pm

Adobe Illustrator (.ai) files

Post by KingKong »

We have alot of images in .ai format, and we would like to keep this format as master format.
We get the following issues in Oxygen Author:
1. If we use the .ai file it renders a preview, but it renders with contents outside the artboard of the .ai file --> Not good. But if we export the xml (dita) file to a pdf, it renders correctly (it only shows what is on the artboard of the .ai file). I know you can have several artboards in an .ai file, but that is not an issue. we only use one.

2. Convert the .ai to .svg with Illustrator editing capabilities. This works, but some files get simplified, for example, gradients get rasterized. This is not the best solution if we want to switch to .svg as master files.

3. Now to the strange thing. If we rename the extension of the .ai file to, for example, .image and use it in Oxygen Author, it displays and exports correctly, as long as the .ai file has an preview image. VERY STRANGE. (the extension could be changed to anything, like .test, .hello, and it works.

So my two main questions then:
Is it a bad solution to rename .ai files. to .image?
Why is it working when we rename the extension?
Radu
Posts: 9651
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adobe Illustrator (.ai) files

Post by Radu »

Hi,

Good question and thanks for the sample AI image.

Oxygen has an AI image handler, it activates when attempting to render images with the ".ai" extension in the Author visual editor. Inside the .ai file (if you open it for example with Notepad) there is an "<xmpGImg:image>....</...>" XML tag containing a base 64 encoded preview image (which in this case is a JPEG which contains both the green and the red rectangles). This preview image is displayed by the AI image handler.

If the same image does not have the ".ai" extension, the AI image handler no longer handles it so it ends up being delegated to other image handlers. The PDF image handler looks inside the image and finds out that it starts with "%PDF", so it figures that it is a PDF image and somehow it manages to render it as a PDF image.

So you would get the same result if you converted "abc.ai" to "abc.pdf", the PDF image handler would take precedence, this time by relying directly on the file extension instead of reading inside the file.

I added an internal issue based on your feedback, pasting the issue ID below for future reference:

EXM-56888 Consider removing the AI image handler

but I'm not sure what to do yet, I do not know much about ".ai" extension, I do not know if for example all ".ai" files are actually PDF images (have inside them the "%PDF" start header). So if for example we remove the AI image handler completely and rely on the PDF image handler in all cases I'm not sure if this will work for all AI files or not.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
KingKong
Posts: 1
Joined: Tue Mar 17, 2026 12:18 pm

Re: Adobe Illustrator (.ai) files

Post by KingKong »

Thanks for the quick reply!
So... did some more testing.
If I save with no PDF compability, it still renders the preview (including objects outside artboard) when it is still an .ai file.
If I rename it to .image, it does not render, see attachment.
I guess as expected...

It would be nice to be able control this in the framework or css. So that I can somehow say:
First, try PDF image handler, if it is not working, fallback to ai preview image handler.
image.png
You do not have the required permissions to view the files attached to this post.
Last edited by KingKong on Tue Mar 17, 2026 5:45 pm, edited 1 time in total.
Radu
Posts: 9651
Joined: Fri Jul 09, 2004 5:18 pm

Re: Adobe Illustrator (.ai) files

Post by Radu »

Hi,
Please see some remarks below:
If I save with no PDF compability, it still renders the preview (including objects outside artboard) when it is still an .ai file.
Oh, so that %pdf header from the beginning of the .ai file appears only if it gets saved with PDF compatibility, noted!
If I rename it to .image, it does not render, see attachment.
I guess as expected...
Yes, the AI image handler only looks for the ".ai" extension, if there is no .ai extension it does not detect the content inside the file to check if it has the AI format or not.
It would be nice to be able control this in the framework or css. So that I can somehow say:
First, try PDF image handler, if it is not working, fallback to ai preview image handler.
We do not have this possibility, I added an internal issue based on your needs, pasting the issue ID below:
EXM-56888 Improve behavior of AI image handler when AI image has PDF image inside
So if we manage to improve on this behavior in a future Oxygen release (delegate from the AI image handler to the PDF image handler if the file starts with %pdf) we will update this thread.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply