Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Translation Object preview


Level 2



I am trying to use the TranslationObject#getTranslationObjectPreview method to get a preview of a page. 


I expect a zip with all files required to open the page offline, independently of AEM.

I would then like to send this archive over http to a server (which I believe is only tangentially important).


My issue is that when I open this zip package, the html page has broken encoding and image links:





Exploring the archive structure a bit I find the images from the body of the article, however, the html does not link to them correctly. I could not find images for the icons or the image from the top of the page.


My question is, am I doing something wrong or is this the full extent of the preview feature that AEM supports?

Below is a screenshot of the code in debug mode showing part of the method used for converting the ZipInputStream, obtained from the TranslationObject, into a ByteArrayInputStream that can be fed to the Apache http client.

The preview shows the content of the buffer, read using UTF8 encoding.Screenshot_1.png


Unless I'm missing something, this shows the locale specific characters are corrupted even before transfer.
Is there maybe some configuration to be done that could remedy this?

3 Replies


Community Advisor

HI @JanHumpal 


We had a similar requirment to create page preview zip. We faced similar issues with zip created from getTranslationObjectPreview so we ended up creating our own utility to create page preview zip. 







Level 2
Thank you for your feedback! I was afraid it might be the case, that circumventing the translation framework here will be necessary.


Level 2

While I appreciate the feedback from Nupur, as it shows that this is not merely a problem local to my setup, I still hesitate to mark it as a final answer to my questions.


I would still like a confirmation, that this is truly a limitation of the translation framework, rather than a case of two different developers running into the same wall.