Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Linking Image field with XML Schema

Avatar

Level 10

I have a requirement that I am working on which would require me to generate dynamic PDF in such a way that the text as well as the images in that PDF should depend on the input XML that I recieve. So in this regard my question is how can I link an image field with an element in the sample data XML or with an element in the schema. Does this feature supported by the tool. Can generated PDF have dynamic images in them.

Any help towards this would be greatly appreciated.

Thanks in advance.

Srini

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

If it is possible can you retrieve the image contents from the DB and embed them in the data file? You will have to base64 encode it.

Paul

View solution in original post

4 Replies

Avatar

Former Community Member

Yes ...the easiest way is to embed the contents of teh image (base64 encoded) into the xml file and then bind the image field to the tag in the XML.

Paul

Avatar

Level 10

Thank you Paul for your reply..

We have the images stored in a fileserver with the .jpeg format. We get the relative path to the folder on the server and passed as part of the XML tag value. In this scenario, can you help me how I can embed the image.. or can I attach the URL path to the property..

Thanks

Srini

Avatar

Correct answer by
Former Community Member

If it is possible can you retrieve the image contents from the DB and embed them in the data file? You will have to base64 encode it.

Paul

Avatar

Level 10

Thank you Paul.. That helps..

Regards

Srini

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----