• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2549
  • Last Modified:

CFDocument Sizing Issue

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
garyttu
Asked:
garyttu
1 Solution
 
siva_sivaCommented:
pdf format is slightly differ than web page format.
0
 
garyttuAuthor Commented:
the entire page is pdf
0
 
digicidalCommented:
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
 
garyttuAuthor Commented:
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
 
andrewlorienCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now