Missing image (logo) as header in PDF on production server

8 posts, 0 answers
  1. rugydp
    rugydp avatar
    15 posts
    Member since:
    Jul 2014

    Posted 16 Mar 2015 Link to this post

    Hello

    I'm trying to export a RadHtmlChart with a header area that contains the company logo. On my development machine everything works fine. The logo appears on screen and in the exported pdf. But on our test server and the customer's test server the logo is visible only on screen and NOT in the PDF. I assume it's a path problem but I can't find any solution. 
    Any ideas somebody?

    Thanks in advance.
    Ruggero

    <div id="PdfOutputArea">
         <div id="PdfHeader" style="visibility: visible;height: 80px;padding-left: 20px;">
            <p>Auswertung erstellt am <%# DateTime.Now.ToString("dd.MM.yyyy") %> durch <%# SessionHelper.BenutzerVorname %> <%# SessionHelper.BenutzerNachname %></p>
            <img src="~/Images/LOGO.png" runat="server" />
         </div>
         <telerik:RadHtmlChart runat="server" ID="OOSChart">
         [... more code ...]
         </telerik:RadHtmlChart>
    </div>

    <script type="text/javascript">
       function ExportOOSChartToPDF(sender, args) {
         $find('<%=RadClientExportManager1.ClientID%>').exportPDF($("#PdfOutputArea"));
       }
    </script>

    var relativePath = "~/api/export/file";
    RadClientExportManager1.PdfSettings.ProxyURL = ResolveUrl(relativePath);
  2. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 16 Mar 2015 Link to this post

    Hi Ruggero,

    The experienced behavior is most probably due to insufficient permissions given to the image shown in the header. You can easily test it by trying to open it directly through the URL, e.g.:
    http://yourSiteName.com/Images/LOGO.png

    Another approach you can try in order to see whether you have enough permissions in the whole Images folder, is the one explained in this help article: An error like "... because the application did not have enough permissions..." occurs only in a production environment

    I hope this information will be helpful for you.

    Regards,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. rugydp
    rugydp avatar
    15 posts
    Member since:
    Jul 2014

    Posted 16 Mar 2015 in reply to Vessy Link to this post

    Vessy, thank you for your answer. I'm afraid it didn't solve my problem. Permissions to the image folder seem to be fine as the image/logo is shown in the browser on any system/server. It just doesn't get displayed in the exported pdf file (on deployed server). Actually, if I try to export all content of the page, no image at all is exported to the pdf file. Only text and the chart...

    Isn't the pdf rendered on client side from javascript?
  5. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 16 Mar 2015 Link to this post

    Hi Ruggero,

    Yes, when using the ClientExportManager the exporting is done on the client, but still if the application does not have permissions to access a file the exporting cannot proceed with it. Nevertheless if the image is loaded properly even when it cannot be exported this should not be the problem in this case.

    I tried to reproduce the problematic behavior on my side but to no avail - the header image was exported properly both through Cassini and IIS. For convenience I am attaching my test page to this reply - can you add it to your application and see whether the problem can be reproduced with it?

    Looking forward to hearing from you,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. rugydp
    rugydp avatar
    15 posts
    Member since:
    Jul 2014

    Posted 17 Mar 2015 Link to this post

    Hi Vessy

    Now I'm feeling quite stupid ;). I had the same problem with your example what me rethink what you said about permissions. The site I'm working on is secured by some IIS authentication method. A user needs to be logged in for access to files and folders. So I disabled authentication for the 'Images" Folder and voila, it works.

    Thank you so much for your help and sorry for the trouble.

    Kind regards,
    Ruggero
  7. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 17 Mar 2015 Link to this post

    Hi Ruggero,

    I am glad the provided example was helpful in narrowing down the source of the problem. As always, should you face any further Telerik related difficulties do not hesitate to drop us a line. :) 

    Regards,
    Vessy
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Tony
    Tony avatar
    7 posts
    Member since:
    Oct 2010

    Posted 17 Jan Link to this post

    Hello,

    I got the similar problem. My logo doesn't get exported to the PDF file. The logo is located in a virtual directory on another drive. I tried the above link to test the folder permissions and every permission has passed. I've used several third party PDF components currently and in the past and never have this issue. Any idea?

    Thanks.

  9. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 20 Jan Link to this post

    Hi Tony,

    Please, examine the following help article and make sure that the suggested response headers are configured:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/clientexportmanager/troubleshooting/known-limitations


    Regards,
    Vessy
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017