Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team,

On my Webpage(exportURL), I have my logo element like below
<img alt="ABC.Com" src="https://tools.abc***.com/mytools/data/logo-transparent.png" width="102px" height="19px">


I am downloading using the below code of evoPdf.
using EvoPdf;
using System.Drawing.Imaging;
...
...
private void pdf_from_url(string exportURL, string filename)
        {
            HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter();

            htmlToPdfConverter.LicenseKey = evoKey;
            htmlToPdfConverter.PdfDocumentOptions.AutoSizePdfPage = true;
            htmlToPdfConverter.PdfDocumentOptions.FitHeight = true;
            htmlToPdfConverter.PdfDocumentOptions.FitWidth = true;
            htmlToPdfConverter.PdfDocumentOptions.JpegCompressionLevel = 0;
            htmlToPdfConverter.ConversionDelay = 1;
            byte[] outPdfBuffer = null;
            outPdfBuffer = htmlToPdfConverter.ConvertUrl(exportURL);
            Response.Clear();
            Response.BufferOutput = true;
            Response.AddHeader("Content-Type", "application/pdf");
            Response.AddHeader("Content-Disposition", String.Format("attachment; filename={1}.pdf; size={0}", outPdfBuffer.Length.ToString(), filename));
            Response.BinaryWrite(outPdfBuffer);
            Response.End();
        }


The logo is displayed in the downloaded pdf file in debug mode and test server. but it is not displaying on the production server.

Kindly do the needful to resolve this.

What I have tried:

Even I have tried with the physical image instead of imgUrl in the IMG tag. still, it is not working.


kindly lemme me if anything is required.
Posted
Comments
Andre Oosthuizen 19-Jul-23 5:43am    
Is there maybe a path difference between the ops server and your test server?
avelsamy 19-Jul-23 6:49am    
https://tools.abc***.com/mytools/data/logo-transparent.png is the correct URL which can be accessible in browser
Richard MacCutchan 19-Jul-23 6:20am    
Where is the code that calls the pdf_from_url function, and what is passed in the exportURL variable?
avelsamy 19-Jul-23 6:49am    
called from the controller. export url is nothing but current web page
Richard MacCutchan 19-Jul-23 7:59am    
Well none of this gives any useful clue as to why it does not work in production. You will need to do some more investigation on the system that is failing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900