Thanks. I'll try that. I just can't figure out what that something else you 
mention is. It's like it loads the quesry (and I dumped it, it's only producing 
one record) and traversing the query once, creating the blank page, then 
traversing the query result a second time to read the data. 


 

-----Original Message-----
From: Jason Fisher [mailto:ja...@wanax.com] 
Sent: Wednesday, May 18, 2011 2:13 PM
To: cf-talk
Subject: re: <cfdocumentitem type="pagebreak">


Sounds like there's something else going on that would cause a blank at the 
beginning, if that's what you're seeing, but the code you've got there will 
also *always* append an extra page break after every record, including the 
first one.  Try this instead:


<cfdocument format="pdf" filename="#ExpandPath(".")#\xxx.pdf">
<cfoutput query>
<cfif currentRow GT 1><cfdocumentitem
type="pagebreak"></cfdocumentitem></cfif>
... query output stuff ...
... end query output stuff ...
</cfoutput>

----------------------------------------

From: "Stephens, Larry V" <steph...@indiana.edu>
Sent: Wednesday, May 18, 2011 2:10 PM
To: "cf-talk" <cf-talk@houseoffusion.com>
Subject: <cfdocumentitem type="pagebreak">

<cfquery ...>
<cfdocument format="pdf" filename="#ExpandPath(".")#\xxx.pdf">
<cfoutput query>
... query output stuff ...
... end query output stuff ...
<!--- just in case the query returns multiple records ---> <cfif 
GetRec.Recordcount GT 0><cfdocumentitem 
type="pagebreak"></cfdocumentitem></cfif>
<cfoutput>

<rest of tags>

What I expect is a pdf file with no blank pages if there is one record. 
(Haven't tested it yet with multiple records.)

What I get (with one record) is a blank page at the top and then my data.

Why does this give me a blank page at the top (and can I stop it)?





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344841
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to