Expand my Community achievements bar.

Native PDF: Cover Page: Cover image: Dynamically pick-up and display

Avatar

Level 2

I've read the help on page templates and can see that we can hardcode a logo, other image, of background image into the design.

 

I know that we can define text variables and display these on the page template.

 

But what do we do if we have images that vary by publication, and we want to display one of those dynamic images on a location on the page?

 

For example, a cover image of the product or additional symbols or logos specific to the publication.

 

Is it possible to define an image variable that can be placed on the page layout design?

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Level 6

I am also interested in the answer to this question.

Avatar

Employee

@Mike-E : there could be two possible solutions to this: 

 

Option 1: if you know that all the maps are of type bookmap, then generally the images that should go on front page can be under frontmatter or some xpath under the bookmap xml

In this case, you can create a metadata field and use the xpath to the image and use it in the template page layout - check this document to know more about metadata fields

 

Option 2: if the map can be ditamap or bookmap, and lets say the image cannot be defined in the map xml then you may use User variable - defining the image path as variable in the output preset, steps as given below

  • create user variable on the output preset and 
  • define the img tag with src path as value of the variable (as of today: path should be relative to the map prefixed with "contents/" - this will be handled in future release) 
  • and use that variable in the template layout
  • the language variables sets are selectable on the output preset "Advanced" tab
This approach is also documented - check this page on Experience League (refer section "Use variables in the Native PDF templates")
 
 
I hope this helps.
 

Avatar

Level 4

@Mike-E @sschnelbach 

The img tag you define in the variable has to literally be the tag. I was confused at first about this so I thought I would write a comment.

i.e.

rkody_0-1729863992458.png

Avatar

Administrator

@Mike-E Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni