Solved

CFDOCUMENT and CSS

Posted on 2013-02-01
7
428 Views
Last Modified: 2013-02-05
I've been playing around with cfdocument and it's driving me absolutely nuts!  I have a simple page that looks something like this

<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>

<cfinclude teamplate="title.cfm">

Tjos os a test


</body>
</html>

When i wrap  a cfdocument around this, it creates the PDF just fine, however the problem I'm having is that the included template does not pickup my stiles.   I don't know what to do to get this fixed.  I want Aial.  Any thoughts.  Thanks in advance
0
Comment
Question by:trifecta2k
  • 4
  • 3
7 Comments
 
LVL 36

Assisted Solution

by:SidFishes
SidFishes earned 500 total points
ID: 38845391
You can't use  link to the style sheet. You need to use @import

It's also picky about doctype

more here http://rip747.wordpress.com/2007/09/10/cfdocument-it-works-if-you-know-how/
0
 
LVL 5

Author Comment

by:trifecta2k
ID: 38847650
I will try that and let you know. Probably won't be able to get to it until Monday.
0
 
LVL 5

Author Comment

by:trifecta2k
ID: 38851223
I did everything and it works for the most part.  I still have one weird issue.  In my PDF I use <cfimage>.  This block isn't hit all the time because some reports have a chart and some don't.  When it hits the <cfimage> tag the font size seems to resize.  Any ideas?  These reports need to look uniform and right now they change size when I add an image.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 36

Expert Comment

by:SidFishes
ID: 38851345
not specifically but there are a couple of things to try

1) make sure you are fully patched. There have been many, many cfdocument issues fixed since the tag was introduced.
2) unless there's a compelling reason, don't use cfimage within the tag. Do whatever image manipulation you need to, write it to disk and then load with a simple <img> tag.
0
 
LVL 5

Author Comment

by:trifecta2k
ID: 38851905
I am fully patched.  I tried just using a regular img and my pdf still looks like it's scaling down.
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 38855924
From what I've seen images with resolution higher than 96 dpi may cuase this scaling issue - you could see if making sure that is the case helps.

you also may want to try forcing the page size of cfdocument by adding the pagetype="letter" attribute (I'd try this one first if you haven't already)
0
 
LVL 5

Author Comment

by:trifecta2k
ID: 38856569
That was it!  Between the pagetype and the css doc I got it to work.  Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

947 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now