Skip to main content
Solved

Write multiple pages to one pdf-file using only one PdfPageFormatter

  • November 29, 2016
  • 9 replies
  • 202 views

peteralstorp
Contributor
Forum|alt.badge.img

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

Best answer by takashi

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

View original
Did this help you find an answer to your question?

9 replies

fmelizard
Contributor
Forum|alt.badge.img+17
  • Contributor
  • November 29, 2016

I made a custom transformer maybe can help you

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


takashi
Supporter
  • Best Answer
  • November 29, 2016

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


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • November 29, 2016

@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)


peteralstorp
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 29, 2016
fmelizard wrote:

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!

 

 


peteralstorp
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 29, 2016
takashi wrote:

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
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 29, 2016
gio wrote:

@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
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 29, 2016
gio wrote:

@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

 

 


redgeographics
Celebrity
Forum|alt.badge.img+49

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.


peteralstorp
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • November 30, 2016

Good, thanks!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings