Conditional PDF cover page image

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
James Swift
Posts: 1
Joined: Mon Aug 05, 2019 4:35 pm

Conditional PDF cover page image

Unread post by James Swift »

Hi everyone, new user here.

I'm looking to create multiple projects that use the same PDF template, but I would like to show a different image on the cover page for each project depending on which Custom Build variable is selected. Is there a way to do this without having a template for each project?

Any help would be appreciated

Thanks
User avatar
Tim Green
Site Admin
Posts: 23181
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Conditional PDF cover page image

Unread post by Tim Green »

Hi James and welcome to the forum!
James Swift wrote:I'm looking to create multiple projects that use the same PDF template, but I would like to show a different image on the cover page for each project depending on which Custom Build variable is selected. Is there a way to do this without having a template for each project?
Yes, what you can do is create a snippet file containing your cover page image in each project with exactly the same name, and then insert this as a topic snippet in the template. The image will then get sourced from the project you are using to publish the PDF:
  1. In your project, look in the Project Explorer on the left and navigate down to Project Files > Topic Files. Create a Topic file there with a simple name, like cover_image or something like that.
  2. Right-click on the new topic in the list on the left, select Include in Builds in the context menu and disable the ALL build option and activate the one for PDF. (When you are making a snippet for HTML you need to disable all build options, including HTML)
  3. Insert your cover image and any cover texts you'd like to have in the topic. Click on the gear icon in the top left corner of the editor window and turn off the topic's header.
  4. In the Manual Designer for the PDF template, select the cover page section, click and drag where you want to insert the image and then select Insert Text Snippet in the Insert menu. Choose the from topic option and enter the ID of the topic file you created in the steps above. Then you can adjust the size of the box that will contain it (you may need to check and re-adjust after publishing the PDF).
If you create a cover page snippet with the same name in all the topics you want to publish with the template you will get a custom cover image and text on each one. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply