5 Replies Latest reply on Oct 26, 2010 2:40 PM by kodemonki

    Images not displaying in CFDOCUMENT PDF

    Drew Nathanson Level 1
      Hi there,

      Has anyone notice any problems with images in dynamic PDF using CFDOCUMENT? I have a site where I create several dynamic PDF document (with images) and all of a sudden, they stop displaying. The only new addition was a SSL for the site.

      Any help would be greatly appreciated.

        • 1. Re: Images not displaying in CFDOCUMENT PDF
          sdsinc_pmascari Level 2
          Saw this on a blog today. Thought you might find it useful:

          If you are using HTTPS and your images do not appear in the pdf/flashpaper, you must ensure the following

          * CF server's certificate is trusted. In other words, certificate of the CA who issued the certificate for you, must be present in the trusted certificate store (runtime/lib/trustStore). You can use keytool to list/view/import/.. certificate in the certificate store.
          If CF is using a self signed certificate, CF's certificate must be present in the trustStore.

          * The certificate is valid and has not expired.

          * Host name of the server must match the host name to which the certificate was issued.
          • 2. Re: Images not displaying in CFDOCUMENT PDF
            Dylan Forbes
            Check these postings (provided by Lossed on another query on this forum). The last link is really simple to implement and provided the real winner solution for me (using SSL):

            The forum posting:
            http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=3&threadid=11 68109&highlight_key=y&keyword1=cfdocument

            One set of things to look at:
            http://tinyurl.com/rl8c5 (converts to this link below):
            http://coldfused.blogspot.com/2005/11/missing-images-in-cfdocument.html

            THE Solution for SSL issues (and possibly others):
            http://tinyurl.com/l9hm4
            http://mkruger.cfwebtools.com/index.cfm/2006/5/30/cfdocument.file
            It states use absolute file addressing to reference the graphics:
            e.g. <img src="file:///d:\mysite\images\myimage.jpg" width="50" height="60">
            • 3. Re: Images not displaying in CFDOCUMENT PDF
              kodemonki Level 1

              I've done everything in the ColdFused blog and nothing has worked.

               

              I tried the absolute file addresses, but that results in an broken image icon that looks like the compatibility mode icon in IE, and that's just when I try to render the page through the browse, no CFDocument involved.

               

              Does anyone have any other suggestions?

              • 4. Re: Images not displaying in CFDOCUMENT PDF
                ilssac Level 5

                kodemonki wrote:

                 

                I tried the absolute file addresses, but that results in an broken image icon that looks like the compatibility mode icon in IE, and that's just when I try to render the page through the browse, no CFDocument involved.

                 

                Does anyone have any other suggestions?

                 

                If you are just using HTML displayed in a browser, then ColdFusion is not involved at ALL in the display of the image.  That is between the browser and the web server.

                 

                The first place to start is to view source in the browser and confirm that the <img....> tag is properly formated with a ligitimate url path in the src="" parameter.

                 

                Secondly, it is really helpful if some CFML and|or HTML code was shown so that we don't have to guess at what you are working with.

                 

                Thirdly, it is a bad idea to append new and different questions to older threads like this, becuase many may not look at it, thinking it is part of a thread they are not interested in.

                • 5. Re: Images not displaying in CFDOCUMENT PDF
                  kodemonki Level 1

                  Thanks, Isaac.

                   

                  My reason for posting that I was trying the src="file://E:\ solution before putting it in CFDocument was that I figured if it didn't work with the browser, it probably wouldn't work with CFDocument, which was probably presumptuous of me.  I just tried using the IP Address instead of E:\etc and it shows up in the browser.  Good news, the IP Addresses fix the logo problem, but not the CFChart problem.

                   

                  Here's the failed img tag:

                  <img src="logo_30.jpg" width="96" height="50" border="0" alt="">

                   

                  Here's the successful img tag:

                  <img src="http://ipaddress/portal/PROD/Forms/monthly_reports/logo_30.jpg" width="96" height="50" border="0" />

                   

                  Here's the chart code:

                  <CFQUERY NAME="GrabData" datasource="admi-prod">
                            sql goes here
                  </CFQUERY>
                  <cfset gwidth = 450>
                  <cfset gheight = 320>
                  <cfset min = int(arrayMin(grabData["total_inventory"])) - 1>
                  <cfif int(arrayMin(grabData["total_idle_capital"])) LT min>
                          <cfset min = int(arrayMin(grabData["total_idle_capital"])) - 1>
                  </cfif>
                  <cfset max = ceiling(arrayMax(grabData["total_inventory"])) + 1>
                  <cfchart scalefrom="#min#" scaleto="#max#" title="Total Closing Inventory & Total Idle Capital" format="jpg" chartheight="#gheight#" chartwidth="#gwidth#">
                          <cfchartseries type="line" query="grabData" valuecolumn="total_inventory" itemcolumn="xlabel"/>
                          <cfchartseries type="line" query="grabData" valuecolumn="total_idle_capital" itemcolumn="xlabel"/>
                  </cfchart>