Skip to main content
Best Answer

Multipage pdf example not working

  • July 28, 2021
  • 2 replies
  • 54 views

arnovananrooij
Contributor
Forum|alt.badge.img+5

Hi,

I found an example for creating multipage pdf on https://www.safe.com/webinars/choosing-the-right-transformer-for-your-data-challenge/?utm_source=youtube&utm_medium=social&utm_campaign=webinar-transformers-2018. I downloaded the workspace pdfpalooza.fmw and tried it. In the demo I see it crates a pdf with multiple pages, but when I run de workspace in FME 2020.1 it writes evething to one page, see attached PNG.

I want to achieve the exact same thing, so multiple pages for one of my own workspaces so it would be nice to have a working example. Anyone?

Best answer by chrisatsafe

Hi @arnovananrooij​ ,

 

Thanks for pointing that out! It looks like one step is missing in that workspace but it's an easy fix.

 

As a quick explanation of the problem, if you edit the PDF custom transformer and go into the PDFPageFormatter's parameters, notice how the page number is 1 - at the moment this is not able to be set by an attribute value so everything coming out of that transformer has a pdf_page_number value of 1.

2021-07-28_9-42-49Since the first transformer in the workspace (Counter) is being used to generate the page number, you can easily replace the pdf_page_number value with the value of the _count attribute in an AttributeManager (See attached).

2021-07-28_9-41-31Making that change should output a 6 page PDF:

2021-07-28_9-45-53Hope that helps!

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

chrisatsafe
Contributor
Forum|alt.badge.img+2
  • Contributor
  • Best Answer
  • July 28, 2021

Hi @arnovananrooij​ ,

 

Thanks for pointing that out! It looks like one step is missing in that workspace but it's an easy fix.

 

As a quick explanation of the problem, if you edit the PDF custom transformer and go into the PDFPageFormatter's parameters, notice how the page number is 1 - at the moment this is not able to be set by an attribute value so everything coming out of that transformer has a pdf_page_number value of 1.

2021-07-28_9-42-49Since the first transformer in the workspace (Counter) is being used to generate the page number, you can easily replace the pdf_page_number value with the value of the _count attribute in an AttributeManager (See attached).

2021-07-28_9-41-31Making that change should output a 6 page PDF:

2021-07-28_9-45-53Hope that helps!


redgeographics
Celebrity
Forum|alt.badge.img+62

A little addition to that: the format attribute pdf_page_number controls which page output goes to. You have to start with page 1 (not 0) and number them consecutively. I.e. if you create pages 1 and 3 the PDF writer will insert a blank page 2 😊