This is a migrated thread and some comments may be shown as answers.

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

7 Answers 508 Views
ClientExportManager
This is a migrated thread and some comments may be shown as answers.
rugydp
Top achievements
Rank 1
rugydp asked on 16 Mar 2015, 07:25 AM
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);

7 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 16 Mar 2015, 12:21 PM
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.

 
0
rugydp
Top achievements
Rank 1
answered on 16 Mar 2015, 01:48 PM
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?
0
Vessy
Telerik team
answered on 16 Mar 2015, 04:00 PM
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.

 
0
rugydp
Top achievements
Rank 1
answered on 17 Mar 2015, 10:00 AM
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
0
Vessy
Telerik team
answered on 17 Mar 2015, 11:17 AM
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.

 
0
Tony
Top achievements
Rank 1
answered on 17 Jan 2016, 09:32 AM

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.

0
Vessy
Telerik team
answered on 20 Jan 2016, 04:12 PM
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
Tags
ClientExportManager
Asked by
rugydp
Top achievements
Rank 1
Answers by
Vessy
Telerik team
rugydp
Top achievements
Rank 1
Tony
Top achievements
Rank 1
Share this question
or