If the image src attribute refers to image folder then it gets rendered in the pdf file. If the src attribute refers to an internal url then the image is not rendered. The other image is stored in the database that is why I need to specify the url.
Do I need to specify the complete path in the src attribute of the image?
Or the pdf engine will be able to extract the image like the browser is able to?
I have the following html which I send to the converter:
Relevant Snippet….
<div class="span12">
<img src="AccessPoint.aspx?action=Report.EditRecord.Start&html=TestUpload.html&script=Show&no_transaction=true&fileid=69">
<img src="images/imgWordDoc.gif">
</div>
I use the following code to generate the pdf:
// byte[] pdfBytes = pdfConverter.GetPdfBytesFromHtmlString(html.ToString());
// send the PDF document as a response to the browser for download
//response.AddHeader("Content-Type", "binary/octet-stream");
string strFileName = "PrintToPDF.pdf";
if (template_defaults["PDF_REPORT_NAME"] != null)
strFileName = template_defaults["PDF_REPORT_NAME"].ToString() + ".pdf";
response.AddHeader("Content-Disposition",
"attachment; filename=" + strFileName + ";size=" + pdfBytes.Length.ToString());
response.ContentType = "application/pdf";
response.Flush();
response.BinaryWrite(pdfBytes);
m_error_log.WriteLine("pdf html = " + html.ToString(), iErrorLog.TITLE2);
response.Flush();