문제

How can I add a large image, that spans over in multiple PDF pages using iTextSharp. I have an image that exceeds the PDF page height and because of it, the image is not fully displaying in the PDF page. Image's last portion is missing.

도움이 되었습니까?

해결책

Please check if this solves your issue:

Document oDocument = new Document();
oDocument.Open();
PdfPTable table = new PdfPTable(1);
table.WidthPercentage = 100;
PdfPCell c = new PdfPCell(image, true);
c.Border = PdfPCell.NO_BORDER;
c.Padding = 5;
c.Image.ScaleToFit(750f,750f); /*The new line*/
table.AddCell(c);  // <-- Add the cell to the table
oDocument.Add(table);

I hope using PDfPTable will probably solve your issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top