-1
我在用戶記錄數據庫中有一個表格,其中有一列Profile Pic
,其中包含像~/images/user.JPEG
這樣的圖像。我想將這些數據導出爲PDF。如何使用iText for .NET在PDF中插入圖像
我正在使用名爲iTextSharp的第三方庫,我想在用戶名前面顯示PDF文件中的圖像。我應該怎麼做?
我綁定網格視圖與數據庫,它顯示在網格視圖中,但是當我在PDF中導出它時,它顯示圖像的位置而不是圖像的位置。
這是我的代碼,它使用表和PdfPCell。
System.Web.UI.WebControls.Image image = (System.Web.UI.WebControls.Image)rows.FindControl("imgprofile");
string imagedummy = image.ImageUrl;
PdfPCell c1 = new PdfPCell(new Phrase(id.Text, verdana));
PdfPCell c2 = new PdfPCell(new Phrase(firstname.Text, verdana));
PdfPCell c3 = new PdfPCell(new Phrase(lastname.Text, verdana));
PdfPCell c14 = new PdfPCell(new Phrase(image dummy));
t1.Add Cell(c14);