• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfimage inside cfdocument problem

New Here ,
Apr 04, 2012 Apr 04, 2012

Copy link to clipboard

Copied

Very strange, but repeatable issue I've run into.  I'm using the barbecue Java barcode generator library to generate code128 compliant barcodes which are then handed to cfimage writeToBrowser to finally end up with printable packing/mailing labels.  When rendered to screen, everything works perfectly, but as soon as I wrap it in a cfdocument tag, so that we can generate as a pdf for printing on a label printer, I'm ending up with the wrong image on the wrong label in a few cases.  It's always the same records that end up reusing an image from an earlier record (and always the same earlier record).  I can check in the ColdFusion8\tmpCache\CFFileServlet\_cf_image folder and see that all the correct images were created by the cfimage tag, but for whatever reason, some of the images don't make it into the pdf, but are replaced by a different barcode from an earlier record.  I can't see any commonality between the two records and if I intentionally remove the earlier record from the query, the proper barcode shows up.

So, any ideas about where to go from here?  Anybody know anything about how cfdocument pulls in images and if there is any kind of caching or prechecking of the images before rendering.  I actually checked to make sure the two files didn't have the same MD5 sum to see if there was something happening there where CF thinks it's the same image.  They were not the same.

I've tried this on two CF 8.01 boxes with the same result.  Always the same records, same images, same problem, even if I limit the query to only the two problem records.  I'm totally stumped.  Anybody?

Views

10.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2012 Apr 05, 2012

Copy link to clipboard

Copied

Lots of interesting ideas, and appreciate the tips on var and scoping but, alas, as I suspected, this is definitely cfdocument losing it's mind.  See code below:

<cfdocument format="pdf" pagewidth="4" pageheight="6.0" pagetype="CUSTOM" margintop="0.17" marginbottom="0.05" marginleft="0.17" marginright="0.17">

<html>

<head></head>

<body>

  <div><img id="_cfimg6949878617879408634" src="_cfimg6949878617879408634.png" /></div>

  <p>00413001811</p>

                    <div><img id="_cfimg300382366701370250" src="_cfimg300382366701370250.png" /></div>

  <p>00403001811</p>

</body>

</html>

</cfdocument>

These are the two images I pulled from the temp directory where cfimage creates them.  Moved them to my test folder and ran the above code and got a pdf with the correct image in the first image tag, but then the same image repeated in where the second image should have been.  And before you ask, yes, I'm certain the images are different.  In fact, here they are:

_cfimg300382366701370250.PNG

_cfimg6949878617879408634.PNG

As before, running without the cfdocument tags renders the correct images in the correct spots.  Can we now just agree that cfdocument is the culprit and maybe at least an acknowledgement from an Adobe rep that there may be an issue here?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 07, 2012 Apr 07, 2012

Copy link to clipboard

Copied

With Jeff.c's earlier images:

_cfimg6949878617879408634.PNG_cfimg6949878617879408634.png

_cfimg300382366701370250.PNG_cfimg300382366701370250.png

I used the following simplified code, and tried every which way to not reproduce the cfdocument problem. For example, I displayed the images on a separate CFM page, downloaded the page by cfhttp, and used cfdocument to display the page content. All my attempts failed. The problem persists.

<cfdocument format="pdf">

<p><img src="_cfimg6949878617879408634.png"></p>

<p><img src="_cfimg300382366701370250.png"></p>

</cfdocument>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 09, 2012 Apr 09, 2012

Copy link to clipboard

Copied

FWIW, I was able to get past this issue by changing the cfimage tag to produce jpg images rather than png.  Now, I have no way of knowing if this actually solved the problem or simply fixed it for these two images I was comparing and if I will now have to be on the lookout for other images with the same problem. 

I did get a reply from Rupesh Kumar (Adobe CF Engineer) from a question I submitted on his ColdFused blog where he stated that the thought this had been fixed in 9.01.  I assured him it had not and pointed him to the bug I filed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Apr 09, 2012 Apr 09, 2012

Copy link to clipboard

Copied

jeff.c wrote:

I did get a reply from Rupesh Kumar (Adobe CF Engineer) from a question I submitted on his ColdFused blog where he stated that the thought this had been fixed in 9.01.  I assured him it had not and pointed him to the bug I filed.

Well at least now you have a firm confirmation of your suspicion it is a it is a bug. Since it sounds like a known issue, did he mention anything about cause or possible work-arounds?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 31, 2012 Aug 31, 2012

Copy link to clipboard

Copied

I am still running into this issue in cf 9.01 as well..... so frustrating to have to use lossy jpegs to render my bar codes into a pdf.

Thanks for incredible troubleshooting and follow up Jeff, you are my hero.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 05, 2012 Nov 05, 2012

Copy link to clipboard

Copied

I'm having the same problem. Before read this topic, I already knew that when you setDrawingText(false) the problem happens and I still need to solve this problem too. I wonder stop use barbecue and try use ".ttf" fonts. Somebody used ".ttf" fonts and got a good result?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 09, 2015 Oct 09, 2015

Copy link to clipboard

Copied

This bug still exists in CF 10.  I'm running CF 10,0,16,293499 w/HF16, 64 bit, on Java 1.8.0_45 on Windows Server 2012

In my case, I am using the IDAutomation barcode aspx  to generate barcode images.  IDAutomation defaults to GIF format.  If CF creates a PDF document with, say, 100 unique barcodes, 1 of them will be displayed incorrectly - a previously generated barcode will appear in place of another.  It is repeatable when generating the same batch given the same barcode sequence - the incorrect barcode image(s) will appear at the same location in the document every time.  When I tell the IDAutomation control to generate JPEG images, the problem goes away.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 09, 2016 Feb 09, 2016

Copy link to clipboard

Copied

LATEST

How do you tell the IDAutomation control to generate JPEG images? I have the same problem

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation