我有iTextSharp的问题。我有一张20000x1000的图片,我必须将其放在页面大小为A1水平的PDF中。棘手的是,我需要将图像的高度调整为PDF,并在图像上打印多页。iTextSharp横向多页超宽图像
我试过这个,但它生成一个页面的PDF和图像调整宽度和高度。
Rectangle pageSize = PageSize.A1;
Document doc = new Document(pageSize.Rotate(), 10f, 10f, 10f, 10f);
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(@"C:\TestFiles\Default.pdf", FileMode.Create));
doc.Open();
Image image = Image.GetInstance(@"C:\TestFiles\image.png");
PdfPTable table = new PdfPTable(1);
table.WidthPercentage = 100;
PdfPCell c = new PdfPCell(image, true);
c.Border = PdfPCell.NO_BORDER;
c.Padding = 5;
c.Image.ScaleAbsoluteHeight(pageSize.Height);
table.AddCell(c);
doc.Add(table);
doc.Close();
非常感谢您的帮助。