• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfhtmltopdfitem _LASTPAGENUMBER Not Working

New Here ,
Jun 11, 2024 Jun 11, 2024

Copy link to clipboard

Copied

Hey all. I have a footer in my PDF document and I'm trying to show "Page 1 of 2", for example.

 

 

<cfhtmltopdfitem type="footer" align="left">
        <cfoutput>
            <body style="padding: 0px; margin: 0px; width: 100%; border-top: 1px solid ##000000;">
                <p style="padding: 0px; margin: 5px 0px 0px 0px; width: 50%; float: left;">As of #dateFormat(now(), "mmm dd, yyyy")#</p>
                <p style="padding: 0px; margin: 5px 0px 0px 0px; width: 50%; float: left; text-align: right;">Page _PAGENUMBER of _LASTPAGENUMBER</p>
            </body>
        </cfoutput>
    </cfhtmltopdfitem>

 

When I render the PDF, it shows "Page 1 of _LASTPAGENUMBER", so it looks like it's not getting a proper value for _LASTPAGENUMBER.
 
I have also tried using:

 

Page #cfhtmltopdf.currentPage# of #cfhtmltopdf.totalPageCount#

 

But it outputs the same thing as above.

Views

79

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Jun 11, 2024 Jun 11, 2024

I may have figured out how to get it to work..

 

I had to add a pace between _LASTPAGENUMBER and my closing </p> tag. This still feels like an issue but at least I can finish my task.

Votes

Translate

Translate
New Here ,
Jun 11, 2024 Jun 11, 2024

Copy link to clipboard

Copied

LATEST

I may have figured out how to get it to work..

 

I had to add a pace between _LASTPAGENUMBER and my closing </p> tag. This still feels like an issue but at least I can finish my task.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation