Skip to main content

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?

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!


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 😊


Reply