添加图像并使用iTextSharp的在多个页面中跨越多个、图像、页面、iTextSharp

2023-09-05 03:33:59 作者:对不起、只是忽然很想你ヴ

我如何添加一个大的图像,即跨越了使用iTextSharp的多个PDF页面。予具有超过PDF页面的高度图象和,因为它,图像没有完全在PDF页面显示。影像的最后部分丢失。

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();
    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);
    oDocument.Add(table);

我希望用 PDfPTable 可能会解决您的问题。

I hope using PDfPTable will probably solve your issue.