【发布时间】:2013-06-13 06:25:43
【问题描述】:
我需要使用 itextsharp 构建一个 pdf。目前我的问题是我无法将表格边框宽度设为 0px。我不想要表格或单元格边框.. 我的代码是
Document Doc = new Document();
//PdfWriter.GetInstance(Doc, new FileStream(Environment.GetFolderPath
//(Environment.SpecialFolder.Desktop) + "\\TTS_Bill.pdf", FileMode.Create));
PdfWriter.GetInstance(Doc, new FileStream(Server.MapPath("~/DMSDOC/DMS_doc.pdf"), FileMode.Create));
Doc.Open();
PdfPTable table = new PdfPTable(1);
table.DefaultCell.Border = PdfPCell.NO_BORDER;
table.TotalWidth = 400f;
table.LockedWidth = true;
iTextSharp.text.Image logo = iTextSharp.text.Image.GetInstance("~/img/val verde hospital.png");
logo.ScaleAbsolute(40, 40);
PdfPCell image_header = new PdfPCell(logo);
image_header.HorizontalAlignment = Element.ALIGN_CENTER;
table.AddCell(image_header)
如何解决或者我的代码有什么错误...
【问题讨论】:
-
请提供一个示例 PDF 来说明问题并允许调查边界的起源。
标签: asp.net itextsharp