Using conditionals in <cfdocumentitem type="header">

Posted on 2011-05-09
Last Modified: 2012-06-21
I don't seem to have an issue with running a conditional in the 'Footer':

<cfdocumentitem type="footer">
<cfif cfdocument.currentpagenumber neq 1>
	page #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#

Open in new window

But if I run a conditional like this in <cfdocumentitem type="header"> it is totally ignored.  I have seen that this is an issue/bug in some of the articles I have read but wondered if anyone has come up with a solution for this.  It really shouldnt be this difficult.

Using: ColdFusion 9.0.1, Windows 2008R2, IIS 7

Thanks in advance
Question by:WebStalkers
    LVL 51

    Accepted Solution

    You're missing an attribute

    <cfdocument format="pdf">
          <cfdocumentitem type="header" evalAtPrint="true">
          <cfif cfdocument.currentpagenumber neq 1>
                <cfoutput>page #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#</cfoutput>
          <cfdocumentitem type="pagebreak"/>
    LVL 2

    Author Comment


    I didn't see that anywhere in the articles I have been looking at. That seems to have solved it.
    Thank you so much!  This has been driving me nuts.
    LVL 51

    Expert Comment

    Add a comment to adobe's online docs.  I'm sure it'll save somebody's sanity ;-)
    LVL 2

    Author Comment

    Good idea..will do!

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
    Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now