I did find one possible solution that I don't like, but should support most 
report templates that need differently sized primary and secondary headers.

I'm creating two cfdocumentsections with different topmargin values.  Each 
cfdocumentsection has their own cfdocumentitem headers.

The next step is to figure out roughly how many lines I can fit on the first 
page with all conditions met as there are a couple different formatting options 
we use for aggregate reports vs individual monthly summaries, etc.

Then loop over the output previous to the cfdocument and parse it in two so you 
have a first page set and then the rest of it.

May have to process the output twice, nearly doubling the processing time, but 
you get the dynamic headers =/

Really wish Adobe would address this.. It just seems crazy that you can't 
specify at least a 2nd level of margins.



> Another CF8 CFDocument problem here...
> 
> With CF7, you could specify a <cfdocument topmargin=""> value that was 
> shorter than the height of the value going in the <cfdocumentitem 
> type="header">.  The cfdocitem header would just continue past and 
> overlap the content below.
> 
> This was fixed by adding a "padding-top:XXX" to the content so that on 
> the first page it just shifted the content down a bit to accommodate 
> for the first page having a larger header.
> 
> However, in CF8, that same setup now shrinks the header so that 
> everything fits within the size set in the cfdocument topmargin value.
> 
> 
> The problem here is that we have been using a PDF for invoicing that 
> has a "master" header on the first page with our logo, company info, 
> etc.
> 
> Then on each subsequent page, a much shorter header with just the 
> client name and the current page number.
> 
> So in CF7, the cfdocument tag had a topmargin value of "1.5".  This 
> along with the extra padding from the top of the div holding the 
> content below worked just fine.
> 
> But now, I have to change the topmargin value to about "3.5" or in 
> order to avoid the header shrinking smaller.
> 
> So not a problem... until you get to the second page.  Now on every 
> following page, there is a large 2" gap between the header and content 
> because of the new larger topmargin value.
> 
> 
> I've tried using CSS tricks like holding the header stuff in a <div> 
> and trying "height/padding/margin" to force the content to appear 
> larger, but now it seems that none of that works and CF scales/zooms 
> the size of the header content to whatever percentage will fit in that 
> topmargin value.
> 
> 
> 
> I did read that CF8 uses the iText libraries and that via createObject 
> you could modify margins with setMargins()... I believe this was on 
> CFSearching.com.
> 
> But I have yet to be able to find an example of how I can insert my 
> <cfscript> code to only change the margins for the first page, or to 
> only change the margins for all non-first pages.
> 
> 
> 
> Has anyone made this work?  This is quite a common layout design for 
> things CFDocument could be used for.. I have to imagine that someone 
> else has run into the same problem?
> 
> 
> Thanks in advance, I love <cfpdf> for its populate feature, so I 
> really want to be able to make that move to CF8 =/


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314782
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to