Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chuck Kirklen 36 posts 184 karma points
    Oct 18, 2018 @ 20:47
    Chuck Kirklen
    0

    Image not showing up when https forced (** update **)

    Darren, PDFCreator 2.2 is working just fine on local machine but with the same exact site running on a server under https, when we try to display the company logo in the header area of the PDF, the logo is blank.

    Commenting out Response.AppendHeader("X-Pdf-Render","true"); we can see the xsl:fo output and it looks fine, but the image isn't appearing on the server running SSL.

    This is actually happening on two different sites, so wondering if there's a pattern. Do you see anything amiss? The image is really there (you should be able to pull it down from where you are), so puzzled.

    Even tried changing http to https in the fo:root tag, thinking the mixed-mode https/http issue might be part of it, but that caused a YSOD when it couldn't reach those sites as https.

    The image is specified in the line that reads:

    <fo:external-graphic content-height="scale-to-fit" height="40px" scaling="uniform" src="https://www.lonestarchemical.com/images/lonestarchemical_logo_PDF.png" />
    

    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format">
        <ibex:properties title="LSC-1000" author="David Young" subject="Lone Star Chemical Product Data Sheet" keywords="data,sheet,product,PDF" creator="PDF Creator for Umbraco" />
        <fo:layout-master-set>
            <fo:simple-page-master master-name="master" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="1.5cm" margin-right="1.5cm">
                <fo:region-body margin-top="2.5cm" margin-bottom="1.5cm" column-count="1" column-gap="0.5cm" />
                <fo:region-before region-name="header" extent="4cm" />
                <fo:region-after region-name="footer" column-count="2" extent="1.5cm" />
            </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="master">
            <fo:flow flow-name="header">
                <fo:table-and-caption border-width="thin" border-color="#c0c0c0" border-style="solid">
                    <fo:table>
                        <fo:table-column column-width="100mm" />
                        <fo:table-column column-width="80mm" />
                        <fo:table-header> </fo:table-header>
                        <fo:table-body>
                            <fo:table-row letter-spacing="0.1em">
                                <fo:table-cell padding="2mm">
                                    <fo:block>
                                        <fo:external-graphic content-height="scale-to-fit" height="40px" scaling="uniform" src="https://www.lonestarchemical.com/images/lonestarchemical_logo_PDF.png" />
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm">
                                    <fo:block text-align="right" font-size="0.8em" padding-top="4mm" color="#d0cec1" letter-spacing="0.3em"> TECHNICAL DATA SHEET </fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                    </fo:table>
                </fo:table-and-caption>
            </fo:flow>
            <fo:static-content flow-name="footer">
                <fo:block font-size="8pt" color="#aaaaaa" border-top-style="solid" border-top-color="#cccccc" border-top-width="2" padding-top="2mm">
                    <fo:block text-align-last="justify">
                        Lone Star Chemical
                        <fo:leader leader-pattern="space" />
                        www.lonestarchemical.com
                    </fo:block>
                    <fo:block text-align-last="justify">
                        130 Old Town Blvd N
                        <fo:leader leader-pattern="space" />
                        Office: (940) 240-0012
                    </fo:block>
                    <fo:block text-align-last="justify">
                        Argyle, TX 76226
                        <fo:leader leader-pattern="space" />
                        Fax: (940) 240-1220
                    </fo:block>
                </fo:block>
                <fo:block font-size="8pt" color="#aaaaaa" text-align="center">
                    Page
                    <fo:page-number />
                    of
                    <fo:page-number-citation ref-id="last-page" />
                    - printed 10/18/2018
                </fo:block>
            </fo:static-content>
            <fo:flow flow-name="xsl-region-body">
                <fo:block background-color="#203875" margin-bottom="0.5cm">
                    <fo:block color="#ffffff" font-family="Arial" font-size="18pt" padding="1mm" margin-left="2mm"> LSC-1000 </fo:block>
                </fo:block>
                <fo:block color="#203875" background-color="#ffffff" margin-left="2mm" padding-after="0.1cm"> Product Description </fo:block>
                <fo:block font-size="10pt" margin-left="2mm">
                    <fo:block margin-bottom="0.5cm"> </fo:block>
                </fo:block>
                <fo:table-and-caption>
                    <fo:table>
                        <fo:table-column column-width="60mm" />
                        <fo:table-column column-width="40mm" />
                        <fo:table-column column-width="40mm" />
                        <fo:table-column column-width="40mm" />
                        <fo:table-header background-color="#203875">
                            <fo:table-row letter-spacing="0.1em">
                                <fo:table-cell padding="2mm">
                                    <fo:block font-size="9pt" font-weight="bold" color="#ffffff">PROPERTY</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm">
                                    <fo:block font-size="9pt" font-weight="bold" color="#ffffff">UNITS</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm">
                                    <fo:block font-size="9pt" font-weight="bold" color="#ffffff">TYPICAL VALUE</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm">
                                    <fo:block font-size="9pt" font-weight="bold" color="#ffffff">ASTM METHOD</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-header>
                        <fo:table-body>
                            <fo:table-row border-after-color="#d0cec1" border-bottom-style="solid" border-bottom-color="#d0cec1" border-bottom-width="thin">
                                <fo:table-cell padding="2mm" padding-left="3mm" background-color="#e6e5df">
                                    <fo:block font-size="9pt" color="#000">Melt Flow</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm" padding-left="3mm">
                                    <fo:block font-size="9pt" color="#000">g/10 min</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm" padding-left="3mm">
                                    <fo:block font-size="9pt" color="#000">800-1800</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm" padding-left="3mm">
                                    <fo:block font-size="9pt" color="#000">D-1238</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                            <fo:table-row border-after-color="#d0cec1" border-bottom-style="solid" border-bottom-color="#d0cec1" border-bottom-width="thin">
                                <fo:table-cell padding="2mm" padding-left="3mm" background-color="#e6e5df">
                                    <fo:block font-size="9pt" color="#000">Density</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm" padding-left="3mm">
                                    <fo:block font-size="9pt" color="#000">
                                        g/cm
                                        <fo:inline baseline-shift="super" font-size="8pt">3</fo:inline>
                                    </fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm" padding-left="3mm">
                                    <fo:block font-size="9pt" color="#000">0.90</fo:block>
                                </fo:table-cell>
                                <fo:table-cell padding="2mm" padding-left="3mm">
                                    <fo:block font-size="9pt" color="#000">D-1505</fo:block>
                                </fo:table-cell>
                            </fo:table-row>
                        </fo:table-body>
                    </fo:table>
                </fo:table-and-caption>
                <fo:block font-size="8pt" space-before="8mm">
                    Before using this product, the user is advised and cautioned to make its own determination and assessment of the safety and suitability of the product for the specific use in question and is further advised against relying on the information contained herein as it may relate to any specific use or application.
                </fo:block>
                <fo:block id="last-page" keep-together.within-page="auto" />
            </fo:flow>
        </fo:page-sequence>
    </fo:root>
    
  • Chuck Kirklen 36 posts 184 karma points
    Oct 19, 2018 @ 17:46
    Chuck Kirklen
    0

    Darren, Just ran a test and removed the https: rewrite rule in IIS (required to force https connection) and the image does indeed show up on the production server when the requesting URL is plain http:

    Image doesn't appear: https://www.lonestarchemical.com/products/polypropylene/homopolymer/lsc-1000/?altTemplate=LSCDataSheetPDF

    Image does appear: http://www.lonestarchemical.com/products/polypropylene/homopolymer/lsc-1000/?altTemplate=LSCDataSheetPDF

    So this appears to have something to do with the site being https-only. Aside from the [fo:root xmlns...] tag, is there anything in the Ferguson.Moriyama.pdf.dll that needs to know that all requests are https?

    Thanks, Chuck

  • Chuck Kirklen 36 posts 184 karma points
    Oct 19, 2018 @ 18:09
    Chuck Kirklen
    0

    A little more data to help track it down:

    In the first line of the xsl:fo view, if i change the <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format"> so that the xmlns:ibex reference is https, no error, but still no image.

    If i change the xmlns:fo reference from http to https, it throws the following error: System.Exception: could not locate fo:root

    I can, however, open a separate browser window and browse to https://www.w3.org/1999/XSL/Format directly and not receive an error.

    Error from referencing xmlns:fo with https

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Oct 20, 2018 @ 13:09
    Darren Ferguson
    100

    Could it be that the site that you are trying to load the image from is secured with TLS 1.2 - whereas the default TLS version for the request would be 1.0 if you are on .net 4.5 ?

    We've seen similar issues elsewhere.

    See here - https://blogs.perficient.com/2016/04/28/tsl-1-2-and-net-support/

    Assuming that you are using .net 4.5 - you may need to have the following line of code in your template someplace:

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

  • Chuck Kirklen 36 posts 184 karma points
    Oct 21, 2018 @ 15:25
    Chuck Kirklen
    0

    Darren, Bingo! You nailed it!

    Specifying the 1.2 protocol per your recommendation above did the trick.

    Appreciate your awesomeness! Thanks, Chuck

Please Sign in or register to post replies

Write your reply to:

Draft