Zoe,
I'm looking at your source code for the page that the PDF is based on
along with the PDF and, this is just a guess, but I think the PDF
image styling may be choking on the designated list (<dl></dl>)
elements in your XHTML.
At least that seems to coincide with the clearing issues. The pdf's
generated by <cfdocument> handle generic HTML and CSS well, but
sometimes have problems with tags that aren't as common.
Also, I've personally found that I sometimes need to "brute force"
the CSS for cfdocument PDF's. By that, I mean calling all your
selectors as specifically as possible and using "!important" more
liberally than you might on an HTML page to override any default
styling. An example using your CSS:
div#content img.right {
/*display: inline;*/
clear: right!important;
float: right!important;
margin: 0 0 .8em 1em;
margin: .2em 0 1em 1.4em;
}
instead of
..right {
/*display: inline;*/
clear: right;
float: right;
margin: 0 0 .8em 1em;
margin: .2em 0 1em 1.4em;
}
Here's a great tutorial on the hierarchy of CSS selectors: http://
www.stuffandnonsense.co.uk/archives/css_specificity_wars.html
Also, remember you are dealing with a print medium instead of a
screen medium. Using "px" and "pt" for dimensions and text sizes
gives you much more control in this medium than in the variable-width
screen where "em" is preferrable.
Hope that helps.
Jon
On Oct 26, 2006, at 3:53 PM, Zoe Gillenwater wrote:
> First things first: I'm not a CF developer. I'm a designer/XHTML/
> CSS person, who works with a CF developer. So please spell things
> out for me, and forgive my ignorance.
>
> A site I am working on uses the cfdocument tag to create PDFs of
> pages. The pages that are being converted are very image-heavy, and
> all of the images are floated, using CSS. They also have CSS clears
> on them to ensure that if one image wants to start before the
> previous one has ended they don't get "hung up" on one another.
> This works great in the HTML, but sometimes -- not always -- the
> clears are not respected in the PDFs that cfdocument outputs. I see
> no pattern in which images get caught on previous images.
>
> Here's a PDF that exhibits the problem (second image gets hung up on
> first one, but third image is fine):
> <http://www.saferoutesinfo.org/guide/tpo_pdf.cfm?
> ITEM=Page&CHAPTER_ID=C353&Page=guiding_principles_for_applying_srts_en
> gineering_solutions.cfm&PageTitle=Guiding%20Principles%20for%
> 20Applying%20SRTS%20Engineering%20Solutions>
>
> Here's the page that the PDF was created from:
> <http://www.saferoutesinfo.org/guide/engineering/
> guiding_principles_for_applying_srts_engineering_solutions.cfm>
>
> Here's the style sheet that styles the PDFs:
> http://www.saferoutesinfo.org/guide/css/pdf.css
>
> Does anyone know if this is a known issue in cfdocument? Is there a
> workaround (other than not floating the images, which I can't do)?
>
> Thanks,
> Zoe
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258173
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4