Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
berry@okaikei #1
cfdocument error red x images on some installs
On 3 different installs of CFMX 7 I have found a problem with including images
in my PDF files. All of the installs have been after a CFMX 6 install was
uninstalled and a fresh install of CFMX 7 was installed. I have tried with
both JPG and GIF. The images display fine in a HTML output of the cfdocument
content. I have tried relative paths, absolute paths and placing the image in
the same directory. Neither of which solve the problem on the 2 servers that
can not include images in the PDF file. Using the same code, the 3rd server
does include images just fine. The code is very basic, a simple table layout
that uses a LOOP to create the data cells. I use the same image over 4 times in
the 4 cells. On the servers that have the issue they take an EXTREMELY long
time to create the PDF when the image is in the PDF. If I pull the img tag out,
it cranks the PDF right out. When I leave the img tag in, the resulting PDF
(which takes 45 or more seconds to create a 1 page PDF which normally takes 1-2
seconds on the good server) has red-x small placeholders where the image should
be. When I double-click on the red x I get a weird looking DHTML popup type box
that is gray and says 'OPTIONS' in it. Definitely not expected behaivor. I am
guessing since my enviroments are mostly stable and work well that this is some
sort of bug in CFMX7. I don't see how I can change any code to make this work
or not work. I am using the exact same code on all 3 systems with no luck.
Even when the code is ONLY an IMG tag, on the two systems that don't work.. it
still doesn't work. So obviously something with the IMG tag isn't working.
Any help????
berry@okaikei Guest
-
CFDocument and Images
Can anyone supply some information on what CFDocument does with images. It seems to spend time on each image so the more you have the longer the... -
Printing Background Images with CFDOCUMENT
Is it possible to set up cfdocuments printing of flashpaper or pdf files so that the page backgrounds carry over to the printed document when you... -
cfdocument tag and repeating images
ok...i have to start off by saying these forums are so frustrating! you cannot search for anything without generating an error when trying to go to... -
cfdocument tag printing high res. images?
Hi, I want to create a printable catalogue from a database using CFML and the new cfdocument tag. The products in the catalogue will be either... -
Bug with CFDOCUMENT and Images
Is there a bug with displaying images within the CFDOCUMENT tag? I have a little 10X10 image that is repeated as a bullet within a document. Some of... -
Michael #2
Re: cfdocument error red x images on some installs
I am having the exact same problem. One server works. The other server does not. I'm using the same code for both servers. I also think this is a bug.
M!ke Dawson
Michael Guest
-
berry@okaikei #3
Re: cfdocument error red x images on some installs
Thank god someone else has this problem. I am sure there is some 'difference'
between the servers but it obviously isn't apparent as I can't see what the
difference is. Probably some DLL version or some program that is installed or
something. Macromedia?? Helloo?
berry@okaikei Guest
-
Michael #4
Re: cfdocument error red x images on some installs
The only thing I noticed is when uninstalling CF 6.1, the uninstaller hung. I
waited a very long time until I could wait no longer. The uninstaller was not
using any processor so I determined it was hung.
I restarted the server, renamed the CFusion directory and then installed CF7.
I checked the install logs and saw that everything was successful.
That was two weeks ago. The server has been running fine. I wonder if a good
uninstall/reinstall would make a difference?
Would you be able to try that on one of your servers? I can't really do it on
my production server except on a Sunday morning. It would be nice to know if
it worked before I took it down for an hour.
Thanks
Michael Guest
-
berry@okaikei #5
Re: cfdocument error red x images on some installs
That is probably the common thread, or what is going to lead to the solving of
this problem. I had two servers out of three that won't work. ALL of them
previously had MX6 on them. The two that didn't work went as follows: Home
(Server 2000) Installed MX7 not knowing it would not be updating MX6. I then
uninstalled MX6 without fail. PDF's with images fail. Client (SB Server 2003)
Uninstalled MX6 with the hung uninstaller as you mention. Everything was
removed per the logs yet after rebooting and installing MX7 PDF's with images
fail. Work (Server 2000) Uninstalled MX6 without an uninstaller failure
(aka, a clean uninstall), rebooted and installed MX7 and PDF's work. I don't
have any other MX6 boxes I want to install on right now. I am thinking I'll
take the home server, wipe MX7 off it and do as much cleanup of the registry
and file system as I can and see if then installing MX7 will resolve the
problem. Is there a way besides the forum to submit a bug to Macromedia? I've
never done anything but post here.
berry@okaikei Guest
-
Michael #6
Re: cfdocument error red x images on some installs
I tried it on another dev server I have. Same problem. That server won't show
images either. I think that server has some other problems with hardware so
it's hard to say what the real problem.
It looks like if you have three servers, two of them will fail while one will
work. Hmmm... Is that the problem? :-)
Have you tried completely rebooting the servers that don't work correctly? I
haven't tried since my prod box needs to stay up until the weekend.
Thanks
Michael Guest
-
berry@okaikei #7
Re: cfdocument error red x images on some installs
Rebooted and still have the same problem.
It HAS to be something left over from MX6.
berry@okaikei Guest
-
Michael #8
Re: cfdocument error red x images on some installs
[url]http://www.macromedia.com/support/email/wishform/?6213=5[/url]
I'm posting a bug right now.
Michael Guest
-
Michael #9
Re: cfdocument error red x images on some installs
This is getting weird. I tried the attached code and it worked. Now, to
figure out what the difference is.
First, I would assume that I'm creating a PDF from a fully-defined HTML
document. In my prior tests, I didn't use any HTML tags except the IMG tag.
Give this a try on your server and see if it works.
I also tried CNN.com and it worked. However, it was pretty slow to load all
those images.
M!ke
<cfhttp url="http://www.google.com/" resolveurl="yes" method="get"></cfhttp>
<cfdocument format="pdf">
<cfoutput>#cfhttp.fileContent#</cfoutput>
</cfdocument>
Michael Guest
-
Michael #10
Re: cfdocument error red x images on some installs
Well, I think I solved the problem as far as I'm concerned. My pages are
behind IIS security which obviously requires a username and password.
I don't know how the PDF generator is accessing the images, but I would guess
through an HTTP request. Since the PDF generator does not allow for
authentication, the image cannot be retrieved. (Access is denied.)
When I pointed the IMG tag to a non-secured image, it worked.
Could this be your problem as well?
M!ke
Michael Guest
-
berry@okaikei #11
Re: cfdocument error red x images on some installs
Tried the code, works fine. I went ahead and added full tags (html, head,
body, etc) to the CFDOCUMENT content to see if that makes a difference, it does
not. I also went ahead and made another page with my content on it, CFHTTP'ed
it and tryed to CFDOCUMENT it (as with the google content). I was getting
nothing but connection failures (common, in my experience, with CFHTTP on
anything other than port 80). I have been calling the pages over a port other
than 80. Tried it both inline (colon 81) and in the port attribute of the
CFHTTP tag. Neither way worked. However, if I run the page locally
(127.0.0.1) with IIS on 80 the CFHTTP works and then the CFDOCUMENT works fine
with that content, displaying images properly. Are you working on an odd
port? Maybe it's a filewall/routing thing? (shouldn't be, but who knows). So
I threw the web back on port 80 for the remote access but continue to use the
CFHTTP. If I don't wrap it in CFDOCUMENT then it displays the content just
fine, images and all. If I do wrap it then it creates the PDF immediately but
still does not show the images. No matter if I put a full path to the images in
the content page or a relative path, it will not show them but does create the
PDF right away. If I put all the content back on the original page, wrap it
in the CFDOCUMENT tag and run it, I get the PDF created right away (mind you
this is on port 80, not on 81) but the images still aren't working. HOWEVER!!
If I use the full LOCAL path to the images (127.0.0.1) IN the CFDOCUMENT code
then it works!!! It's almost as if when the code is in the CFDOCUMENT tag it
is running as a local application and needs to find items locally. So weird!
Sorry if my details are confusing, I was writing this as I did it as to not
miss anything I tried. So it seems like it is the path to the images that is
the problem in combination of a firewall/router, port settigns and such. It's
like the CFDOCUMENT tag can't find the images to include and that is why they
are a red X. So try these items out on your app and let me know if it is the
port, path, etc which solves the problem.
berry@okaikei Guest
-
Michael #12
Re: cfdocument error red x images on some installs
However, if I run the page locally (127.0.0.1) with IIS on 80 the CFHTTP works
and then the CFDOCUMENT works fine with that content, displaying images
properly. Are you working on an odd port? Maybe it's a filewall/routing
thing? (shouldn't be, but who knows). So I threw the web back on port 80 for
the remote access but continue to use the CFHTTP. If I don't wrap it in
CFDOCUMENT then it displays the content just fine, images and all. If I do wrap
it then it creates the PDF immediately but still does not show the images. No
matter if I put a full path to the images in the content page or a relative
path, it will not show them but does create the PDF right away. If I put all
the content back on the original page, wrap it in the CFDOCUMENT tag and run
it, I get the PDF created right away (mind you this is on port 80, not on 81)
but the images still aren't working. HOWEVER!! If I use the full LOCAL path
to the images (127.0.0.1) IN the CFDOCUMENT code then it works!!! It's almost
as if when the code is in the CFDOCUMENT tag it is running as a local
application and needs to find items locally. So weird! Sorry if my details
are confusing, I was writing this as I did it as to not miss anything I tried.
So it seems like it is the path to the images that is the problem in
combination of a firewall/router, port settigns and such. It's like the
CFDOCUMENT tag can't find the images to include and that is why they are a red
X. So try these items out on your app and let me know if it is the port,
path, etc which solves the problem.
Tried the code, works fine.
Glad to hear it
I can't run it on any port other than 80 since this is on my production
server. Also, I can't use 127.0.0.1 since I have specific IP addresses for my
web sites. In other words, I don't use the hardware's IP address for a web
site.
I know it's not a firewall or routing problem because I'm doing this
internally on our network with no firewall between me and the server.
So, if you don't have web server security setup, then you think the problem is
with your ports? It's possible cfdocument can't handle that very well, but
that should have been caught during beta testing. I'm sure many people tested
this feature with CF's built-in web server that doesn't run on port 80.
Michael Guest
-
Michael #13
Re: cfdocument error red x images on some installs
Tried the code, works fine.
Glad to hear it
I can't run it on any port other than 80 since this is on my production
server. Also, I can't use 127.0.0.1 since I have specific IP addresses for my
web sites. In other words, I don't use the hardware's IP address for a web
site.
I know it's not a firewall or routing problem because I'm doing this
internally on our network with no firewall between me and the server.
So, if you don't have web server security setup, then you think the problem is
with your ports? It's possible cfdocument can't handle that very well, but
that should have been caught during beta testing. I'm sure many people tested
this feature with CF's built-in web server that doesn't run on port 80.
Michael Guest
-
berry@okaikei #14
Re: cfdocument error red x images on some installs
It doesn't seem that is so much a port issue but more the direct path from the
CALLING page to the images at the time it runs the CFDOCUMENT tag. I'm not
sure what the distinction is or where the problem lies, but if I call a page
with a FQDN but use a local address to the image (127.0.0.1) it will work.
Otherwise, it will not. Something about resolving the name or accessing the
image, etc. The function that calls the image for CFDOCUMENT is picky as to how
you create the path to it.
berry@okaikei Guest
-
berry@okaikei #15
Re: cfdocument error red x images on some installs
Well, now that I can get images to work I have found another problem. I have
9 instances of a loop on the page. Each instanace displays about 10 images.
Each loop reuses the same 10 images. I seem to be getting erratic results as
to when it will display the image at the correct size or when I will
arbitrailaly make the image larger. I have put image sizes on all tags and that
does not help. Right now it seems like the first instance displays the proper
size with the other 8 displaying the same, wrong, large size. ARGH!!
berry@okaikei Guest
-
Michael #16
Re: cfdocument error red x images on some installs
Hmmm. I just did a simple loop 10 times over my image. It worked fine. I do specify the height and width of the image.
I think you are getting there. Don't give up just yet!
Michael Guest
-
berry@okaikei #17
Re: cfdocument error red x images on some installs
HAHAHA... here is a link to the PDF I am creating. You can see what happens:
[url]http://www.magicalproductions.net/GuestPasses.pdf[/url] You can see what happens. I
originally was using code that used style sheets to give a height and width to
the table inside the document for a precise layout. It worked fairly well, but
I thought that this might be a problem and so I removed them, converted them to
pixel dimensions (based on 72 DPI) and tried that, no luck. I then just did a
percentage width of the table and columns and still, no luck. This is very
discouraging. Did Macromedia even test this tag out besides a 'Hello World!' ?
ARGH!
<cfdocument format="pdf"
filename="#application.system_root#\downloads\#fil ename#" pagetype="letter"
orientation="landscape" fontembed="yes" overwrite="yes" margintop="0.75"
marginbottom="0.75" marginright="0.5" marginleft="0.5">
<cfloop query="qryPassOrders">
<cfif qryPassOrders.cardtype EQ 1>
<cfset thename = qryPassOrders.firstname & " " & qryPassOrders.lastname>
<cfelseif qryPassOrders.cardtype EQ 2>
<cfset thename = qryPassOrders.proname>
<cfelseif qryPassOrders.cardtype EQ 3>
<cfset thename = qryPassOrders.spouse_first & " " &
qryPassOrders.spouse_last>
</cfif>
<cfif qryPassOrders.zip4 NEQ "">
<cfset thezip = qryPassOrders.zip & "-" & qryPassOrders.zip4>
<cfelse>
<cfset thezip = qryPassOrders.zip>
</cfif>
<table border="0" style="width: 10 in; height: 7 in;" cellpadding="0"
cellspacing="0">
<tr>
<cfloop from="1" to="4" index="i">
<td align="center" style="width: 2in;"><img
src="http://magicserver/guestpass_castlewireframe.gif" alt="" border="0"
width="75" height="79"><br><span style="font-family: Arial; font-size: 12pt;
font-weight:
bold;"><strong>#thename#</strong><br>#qryPassOrders.membernumber#</span><br><spa
n style="font-family: Arial; font-size: 9pt;">invites you to use this card to
visit<br><span style="font-family: CloisterBlack BT; font-size: 16pt;">The
Magic Castle</span><br>7001 Franklin Ave.<br>Hollywood, CA 90028<br>Dinner
Reservation Required<br>(323) 851-3313<br>Strict Dress Code No Casual
Wear<br>Coats/Ties Elegant Evening Attire<br>Door Charge $15 Per Person<br>No
One Under 21 Admitted</span><br><img
src="http://magicserver/images/barcode/start.gif" alt="" border="0" width="17"
height="54"><cfloop from="1" to="#Len(qryPassOrders.membernumber)#"
index="i"><img
src="http://magicserver/images/barcode/#Mid(qryPassOrders.membernumber, i,
1)#.gif" alt="" border="0" width="17" height="54"></cfloop><img
src="http://magicserver/images/barcode/g.gif" alt="" border="0" width="17"
height="54"><img src="http://magicserver/images/barcode/start.gif" alt=""
border="0" width="17" height="54"></td>
</cfloop>
<td align="center" style="layout-flow: vertical-ideographic; width:
2in;"><p style="layout-flow:
vertical-ideographic">#thename#<br>#qryPassOrders.street#
#qrypassorders.unit#<br>#qryPassorders.city#, #qrypassorders.state#
#thezip#</p></td>
</tr>
<tr>
<cfloop from="1" to="5" index="i">
<td align="center" style="width: 2in;"><img
src="http://magicserver/guestpass_castlewireframe.gif" alt="" border="0"
width="75" height="79"><br><span style="font-family: Arial; font-size: 12pt;
font-weight:
bold;"><strong>#thename#</strong><br>#qryPassOrders.membernumber#</span><br><spa
n style="font-family: Arial; font-size: 9pt;">invites you to use this card to
visit<br><span style="font-family: CloisterBlack BT; font-size: 16pt;">The
Magic Castle</span><br>7001 Franklin Ave.<br>Hollywood, CA 90028<br>Dinner
Reservation Required<br>(323) 851-3313<br>Strict Dress Code No Casual
Wear<br>Coats/Ties Elegant Evening Attire<br>Door Charge $15 Per Person<br>No
One Under 21 Admitted</span></td>
</cfloop>
</tr>
</table>
</cfloop>
</cfdocument>
berry@okaikei Guest
-
Michael #18
Re: cfdocument error red x images on some installs
I see what you mean. What if you specify something that "breaks" the same url such as:
img src="image.gif?id=#randomnumber#"
Would that make a difference?
Michael Guest
-
berry@okaikei #19
Re: cfdocument error red x images on some installs
You are a saint!!
It works!
Chaulk another bug up.
berry@okaikei Guest
-
Michael #20
Re: cfdocument error red x images on some installs
Woohoo! I'm on a roll today!
Can you email me a link to your page? I'd like to see the result.
This is a very cool idea to use CF to create invites and other similar items.
I'll have to run this by our University Relations and Publications groups.
M!ke
Michael Guest



Reply With Quote

