c#_pdf
例子 https://jingyan.baidu.com/article/93f9803f7ab544e0e46f55e6.html
//创建页面大小
Rectangle pageSize = new Rectangle(1000,500);
Document document = new Document(pageSize,10,10,120,80);
string imgurl = @"C:\Users\topo\Desktop\IX6TQ@0XOIB_PIJE%27LTFI.jpg";
iTextSharp.text.Image imag = iTextSharp.text.Image.GetInstance(imgurl);
imag.SetAbsolutePosition(50,50);
PdfWriter writer = PdfWriter.GetInstance(document,new FileStream(@"C:\Users\topo\Desktop\123.pdf",FileMode.Create));
document.Open();
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();

浙公网安备 33010602011771号