Link to home
Start Free TrialLog in
Avatar of agcsupport
agcsupportFlag for United States of America

asked on

PDF not being created with images on some computers accessing a Coldfusion server

I have a windows 2003 server running Coldfusion. I have created basic html forms that the user fills out. On submit, the server creates a PDF using the <cfdocument> tag. It then emails the document and then opens it in the client browser so it can be printed.  The computers are all corporate and generally standard. They run Windows XP and use IE for a browser. On most of the client computers using the form everything works fine. On a hand full of machines, however, the PDF gets created with boxes containing a red x where the images should be. I have looked at some of the machines to be sure they were standard and had the right versions of windows and browser. I tried the very simple code listed below in case there was some sort of memory issue. I get the same result. On most machines it works fine but on some even this simple code creates a PDF without images. Is there some browser setting I am missing?
<cfdocument format="pdf">
	<img src="images/agclogo.jpg" width="100px" />
</cfdocument>

Open in new window

Avatar of erikTsomik
erikTsomik
Flag of United States of America image

what is CF version are you using
is that a CF 7 ?

Avatar of agcsupport

ASKER

I am using CF8.
try this

<cfset LImage="images/agclogo.jpg">
<cfdocument format="pdf">
        <img src="#lImage#" width="100px" />
</cfdocument>
It does the same thing.

I noticed a posting describing image issues that are similar but on a previous version. In my case, however, the problem seems to be with specific machines as opposed to the amount of load on the server cpu. I wonder if there is some way to slow down the PDF process to be sure the images render properly, or use another type that would render more quickly? Just a thought based on the note below.
Unfortunately this person did not get a response.

----- similar problem ------

We are running CFMX7 on a Windows 2003 Server w/SP1 installed. Server is 2-cpu
Dell 2650.

We have a page with 8 photo images on it. If I load the page using cfhttp and
put the content into a PDF document using cfdocument, I can get one of two
results:

1. Most often, the first one or two images render OK, and the rest render at
too high a magnification and as if the image was cropped on the bottom and
right. In other words, we see the upper left corner of the image. This
happens when there is little CPU load on the server (i.e., 20% or lower).

2.Once in a while, all of the images in the page render properly. This ALWAYS
SEEMS TO HAPPEN when there is a fair amount of CPU load on the server (perhaps
50% or higher).

This is quite repeatable. There appears to be a timing issue with the
rendering of images in PDF files created by cfdocument. It is as if the
document is being created faster than the images can be rendered if there is
enough CPU speed available on the server.

We have width and height values in all the images.

Have seen several threads about improper image behavior like this, so thought
these results might be of interest. If anyone has a suggestion or a solution,
it would be much appreciated. -bg
SOLUTION
Avatar of SidFishes
SidFishes
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That if you have CF 7
i believe i gave the correct answer