• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfdocument format = PDF - does not format correctly

Guest
Dec 13, 2010 Dec 13, 2010

Copy link to clipboard

Copied

Greetings

I am simply attempting to print invoices from a query that displays correctly on the cfm result page, but using cfdocument to render a PDF version (to mail out) does not format even remotely close to the cfm page.

I tried every conceivable method I know of, including:

Formating the cfm page (via CSS and hardcoded table width) to be 612 px X 792 px (8.5 X 11 in), and here is the cfdocument code:

<cfdocument
format="pdf" 
pageType="custom"
unit="in"
marginbottom="0.75"
marginleft="0.75"
marginright="0.75"
margintop="0.75"
pageHeight="11"
pageWidth="8.5"
mimeType="text/html"
fontembed="yes"
orientation="portrait">

<style type="text/css">
@Import url(css/moorings.css);
</style>

<html> blah blah </html>
</cfdocument>

The rendered PDF file is 4.5 X 5 in- (both in IE and Firefox) What am I missing here?

CF 9

Thanks in advance, as always.

TOPICS
Reporting

Views

3.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 15, 2010 Dec 15, 2010

Copy link to clipboard

Copied

LATEST

Well, in answer to my own question, the solution is in the CSS, using tables and CSS:


set table height and width to 100%

set font-size:100%;

set header font, bolder, larger :125%;, etc.


Also using the cfdocument attributes as shown in the posting


The PDF now prints correctly, margins are perfect.

Now I have to figure out how to loop through the 900+ records, convert each to a PDF and print one copy of each-

Anyone?

Thanks....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation