Hi, I'm having problem showing images and css style on a page which I use ASPXToPDF to convert the page into a pdf file.
If I comment out the RenderAsPDF line, the page can be shown with the image and css style without no problem on the browser. However, if I convert it to PDF with the RenderAsPDF method, then the image will be broken, and the css style doesn't apply.
To give you the background of this page:
it is hosted under the following structure:
/ is the root of the host
/dev/Schools/hamtest1.aspx is the page I'm talking about
/dev/Schools/images/ATA_header.jpg is an image I need to reference in the page
/dev/Schools/Styles/Sitepdf.css is the css stylesheet I need to use on the page, thus the resulting pdf
when I try to get the HtmlToPdf.Options.BaseUrl in the BeforeRender event handler, the value is "https://www.aed-technical-assessments.com/dev/schools/"
With the information above, I've put the css style and image tags as follow:
<link href="Styles/Sitepdf.css" rel="stylesheet" type="text/css" />
<img src="images/ATA_header.jpg" alt="" />
But the problem still exists and I can't see the image and style in the rendered pdf, can someone from the support team help please?
The page is located at:
To see it in plain html:
https://www.aed-technical-assessments.com/dev/schools/hamtest1.aspxTo see it rendered in pdf:
https://www.aed-technical-assessments.com/dev/schools/hamtest1.aspx?pdf=trueNote: I just use the querystring to toggle if the RenderToPdf method will execute or not.