?
Solved

CFDocument Sizing Issue

Posted on 2007-10-11
5
Medium Priority
?
2,519 Views
Last Modified: 2010-08-25
I'm using CF8 (although I had this problem in CF7 as well). I have the only hotfix installed.

When I use CFDocument, the header and footer are smaller in scale than the body.

Here is example code:

<cfdocument format="pdf">
<cfdocumentitem type="header">
<table>
<tr>
<td>testing</td>
<td>testing2</td>
</tr>
</table>
</cfdocumentitem>
<table>
<tr>
<td>testing</td>
<td>testing2</td>
</tr>
</table>
<cfdocumentitem type="footer">
<table>
<tr>
<td>testing</td>
<td>testing2</td>
</tr>
</table>
</cfdocumentitem>
</cfdocument>

Am I missing something?
0
Comment
Question by:garyttu
5 Comments
 
LVL 5

Expert Comment

by:siva_siva
ID: 20056866
pdf format is slightly differ than web page format.
0
 

Author Comment

by:garyttu
ID: 20056887
the entire page is pdf
0
 
LVL 9

Expert Comment

by:digicidal
ID: 20065535
I have usually defined all of my font styles with CSS for the documents.  However, I haven't tried this with the header and footer... I would assume that they would utilize defined CSS styles however since they are part of the HTML output rendered into PDF.  One other thing you can do which I have used for particularly difficult pdf page rendering (image placement like for letterhead, etc..) is to define my page layout using the ColdFusion Report Builder and just including the rendered report template as the source.

Your solution may require more fluidity that <cfreport> provides however, in which case I would try working with CSS to define all the styles in the <cfdocument> that you desire.
0
 

Author Comment

by:garyttu
ID: 20067039
They both support CSS although with or without it, they still are sized differently. I have done a straight table without CSS and ones with CSS. I know CSS is working for inside and outside the header because I can do a style font-size and the size adjusts. The problem is 24 px font for one does not display the same for the other.

I'll check out the report builder, but most likely I imagine you're right that we're going to need more fludity.

 
0
 
LVL 3

Accepted Solution

by:
andrewlorien earned 1000 total points
ID: 22270920
I know this is a very old question, but google found it...

the problem is that in CF8 the header is forced to fit inside the top margin, and the footer is forced inside the bottom margin.  so no matter what you put in your css, the whole header will be squeezed into the default margintop, and your fonts and images will look too small.

solution:  add marginTop and marginBottom (and unit if you're not american) to your cfdocument tag:
<cfdocument format="PDF" pagetype="A4" marginTop="5" marginBottom="2" unit="cm">

Open in new window

0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

571 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