iTextSharp.text.Rectangle pageSize = new iTextSharp.text.Rectangle(1000, 500);
string imgurl = @"C:\Users\topo\Desktop\IX6TQ@0XOIB_PIJE%27LTFI.jpg";
Document document = new Document(pageSize, 10, 10, 120, 80);
PdfPTable pTable = new PdfPTable(new float[] { 180, 140, 140, 160, 180, 140, 194 });
pTable.TotalWidth = 1000;
pTable.LockedWidth = true;
PdfPCell cellll = new PdfPCell(new Paragraph("单元格"));
cellll.HorizontalAlignment = 1;
cellll.PaddingBottom = 10;
cellll.PaddingTop = 10;
cellll.BorderColor = BaseColor.BLUE;
cellll.SetLeading(1.2f,1.2f); pTable.AddCell(cellll);
iTextSharp.text.Image imag = iTextSharp.text.Image.GetInstance(imgurl);
imag.SetAbsolutePosition(50,50);
document.Add(pTable);
PdfWriter writer = PdfWriter.GetInstance(document,new FileStream(@"C:\Users\topo\Desktop\123.pdf",FileMode.Create));
document.Open();
//pdf图片
writer.DirectContent.AddImage(imag);
document.Add(new iTextSharp.text.Paragraph("hello worlasdasasdasdasdd"+"sdasdasd"));
document.AddTitle("标题");
document.AddSubject("主题");
document.AddKeywords("关键字");
document.AddCreator("创建者");
document.AddAuthor("作者");
document.Close();
writer.Close();
相关文章
- 11-06字节跳动正式启动2021届秋季校招!分享PDF高清版
- 11-06写代码被打死系列
- 11-06Python 中写一个装饰器实现限制频率访问
- 11-06文件操作,读文件或者写文件
- 11-06写日志
- 11-06读者写者问题(读者优先/读写公平/写者优先)
- 11-06VIVADO 2017.4烧写QSPI FLASH
- 11-06Zynq NOR FLASH 烧写失败
- 11-06写两个函数,分别求最大公约数和最小公倍数,用主函数调用这两个函数,并输出结果。两个整数由键盘输入。
- 11-06在浏览器外打开PDF文档