Hi,
How does CFDocument, serving a PDF, go about actually getting images?
We have a fairly complex report that returns a PDF with a fair amount
of CFCharts within it. We were initially seeing a lot of timeouts
creating the image, then moving the site to a multi-instance CF caused
more mahem. So we changed the code to first save the image to a
temporary location and generate the PDF from that. All was going
well, we thought.
There are two questions in a report (not all) where the image
displayed for the answer is wrong. Running the same report outside of
the CFDocument producs the correct output. In both cases, the correct
images are written to disk. The image shown in these two cases are
another image also included in the report. First we thought it was a
CF9 v CF901 problem as the Dev server is 901 but the live server is 9.
However I've managed to reproduce the problem on CF901 with two images
and a very simple table. The image files themselves are different,
I've tried getting MD5s of the images and these differ. When run,
there are two images embedded in the document, but both are of the
first image encountered. Changing the order of the images changes the
output.
In attempting to debug this, we have tried using UUIDs to ensure the
filenames are unique, adding an ?rnd=#CreateUUID()# to attempt to stop
caching, all have failed.
The only way I've managed to get the images to work properly (as I
thought it was an HTML issue to start with) is to watermark the images
like:
<cfif FileExists(CFChartOthers.FilePath)>
<cfset localVars.oImage = ImageRead(CFChartOthers.FilePath) />
<cfset ImageSetDrawingColor(localVars.oImage, "##000000") />
<cfset ImageDrawText(localVars.oImage, CFChartOthersID, 10, 10) />
<cfset ImageWrite(localVars.oImage, CFChartOthers.FilePath) />
</cfif>
This makes the image ugly, but the correct one. Strangley, if I
change the SetDrawingColor to white, as the text appears over a white
background, then the same problem persists...
Has anyone got any ideas, as I'm now stumped...
Kind regards
Jedi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339430
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm