Skip to main content

Hi gurus.

Problem again. I have a varying amount of objects and I want to use only one PpdfPageFormatter to write these into separate pages of ONE pdf-file. I'm assigning every object a unique pdf_page_number and thought this would do the trick, but it doesn't.

Reading the documentation it seems like I need a new PdfPageFormatter for every new page. Can this really be correct? Or am I doing something stupid again?

Peter

I made a custom transformer maybe can help you

https://hub.safe.com/transformers/pdfmultipageset


Hi @peteralstorp, how about overwriting pdf_page_number with appropriate page number after the PDFPageFormater?


@peteralstorp

Create groups (create a group_id)from the attributes, set a counter (start count = 1) grouped by your group_id to them.

Use pdfpageformater, with default pagenumber = 1

After pdfpageformatter create attribute pdf_page_number = _count.

(like Takashi said, create pdf_page_number after the pdfpageformatter)

Just make sure to group the objects by a counter (starting at 1)


I made a custom transformer maybe can help you

https://hub.safe.com/transformers/pdfmultipageset

Thank you, Corrado, I will look into this when I have more time!

 

 


Hi @peteralstorp, how about overwriting pdf_page_number with appropriate page number after the PDFPageFormater?

I knew it, I WAS doing something stupid! You're absolutely right, Takashi. THANKS!

 

 


@peteralstorp

Create groups (create a group_id)from the attributes, set a counter (start count = 1) grouped by your group_id to them.

Use pdfpageformater, with default pagenumber = 1

After pdfpageformatter create attribute pdf_page_number = _count.

(like Takashi said, create pdf_page_number after the pdfpageformatter)

Just make sure to group the objects by a counter (starting at 1)

Thanks for being thorough, Gio, I sometimes need that! Will have a go at this now!

 

 


@peteralstorp

Create groups (create a group_id)from the attributes, set a counter (start count = 1) grouped by your group_id to them.

Use pdfpageformater, with default pagenumber = 1

After pdfpageformatter create attribute pdf_page_number = _count.

(like Takashi said, create pdf_page_number after the pdfpageformatter)

Just make sure to group the objects by a counter (starting at 1)

My question was correctly answered by T. I wish I could mark both answers as CORRECT, but it's not possible. Thanks again. Peter

 

 


The right answer has already been given, but I would like to add this:

Make sure you don't leave any gaps in your page numbering. E.g. if you supply page numbers 1, 2, 3 and 5 the PDF Writer will make an empty page 4.


Good, thanks!


Reply