-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);