画像の src 属性が画像フォルダーを参照している場合、pdf ファイルでレンダリングされます。src 属性が内部 URL を参照している場合、画像はレンダリングされません。他の画像はデータベースに保存されているため、URL を指定する必要があります。
画像の src 属性に完全なパスを指定する必要がありますか?
それとも、ブラウザができるようにpdfエンジンが画像を抽出できるでしょうか?
コンバーターに送信する次の html があります。
関連スニペット…。
<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>
次のコードを使用して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();