CFDocument page numbers don't work unless evalAtPrint is true

Description

Take the simple PDF at the bottom. On Adobe ColdFusion, the page numbers are correctly

  • 1/3

  • 2/3

  • 3/3

But on Lucee they are

  • 1/1

  • 1/1

  • 1/1

on each page UNLESS you add evalatprint="true" to at least the header or footer.
According to Adobe's docs

The cfdocumentsection tag forces a page break so that each section starts on a new page.ColdFusion

Therefore, it should be possible to know the before-print page numbers.

Even an explicit

<cfdocumentitem type = "pagebreak"/>

inside the loop does not trick Lucee into counting the pages. Note, an explicit page break WILL work correctly with no document sections.

<cfdocument format="PDF"> <cfoutput> <cfloop from="1" to="3" index="i"> <cfdocumentsection> <cfdocumentitem type="header"> Header #cfdocument.currentpagenumber# / #cfdocument.totalpagecount# </cfdocumentitem> page content <cfdocumentitem type="footer"> footer #cfdocument.currentpagenumber# / #cfdocument.totalpagecount# </cfdocumentitem> </cfdocumentsection> </cfloop> </cfoutput> </cfdocument>

Attachments

2
  • 26 Aug 2021, 09:09 pm
  • 26 Aug 2021, 09:09 pm

Activity

Show:

Pothys - MitrahSoft 3 September 2021 at 15:47
Edited

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.9.4-SNAPSHOT and pdf version 1.0.0.97-RC too. Using cfdocumentsection and cfdocumentitem without evalAtPrint=true, lucee print the incorrect page number. Seems ACF works fine. Using evalAtPrint = true,works fine in lucee too.

Details

Assignee

Reporter

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Priority

Created 26 August 2021 at 21:06
Updated 3 September 2021 at 15:48

Flag notifications