PDF Rendering is Broken with Huge Images in a Table

Hello Aspose,

we are suffering from a major bug if images appear in a table. The resulting PDF is incomplete if two following images are too large for one page. The expected result would be that the 2nd image is appearing on the next page. The actual result is that the complete content of the page after the 1st image is not part of the PDF (what ever will follow, e.g. text).

See this snippet:
private static string ImageInTableBug(Page page)
{
const string path = @“…”;

AddImageTable("Overlay of QA Projections for (ZY) Plane [red = LSO, blue = HwMuMap]");
AddImageTable("Overlay of QA Projections for (XY) Plane [red = LSO, blue = HwMuMap]");
AddImageTable("Overlay of QA Projections for (XZ) Plane[red = LSO, blue = HwMuMap]");
Console.WriteLine("Images in page: {0}", page.Paragraphs.Count);
return Path.Combine(myDataDir, "ImageInTableBug.pdf");

void AddImageTable(string image)
{
    var imageTable1 = new Table() { IsBroken = false, Broken = TableBroken.None, ColumnAdjustment = ColumnAdjustment.AutoFitToWindow};
    var row11 = imageTable1.Rows.Add();
    var cell11 = row11.Cells.Add();
    var image11 = new Image
                  {
                      File = Path.Combine(path,image + ".png")
                  };
    cell11.Paragraphs.Add(image11);

    var row12 = imageTable1.Rows.Add();
    var cell12 = row12.Cells.Add();
    var image12 = new Image
                  {
                      File = Path.Combine(path, "good.png")
                  };
    cell12.Paragraphs.Add(image12);

    var row13 = imageTable1.Rows.Add();
    var cell13 = row13.Cells.Add();
    var text13 = new TextFragment(image);
    cell13.Paragraphs.Add(text13);
    page.Paragraphs.Add(imageTable1);
}

}

The images I use are attached.
Please provide a fix or a workaround.

Regards
Gerd
good.png (605 Bytes)

Overlay of QA Projections for (ZY) Plane [red = LSO, blue = HwMuMap].png (51.6 KB)

Overlay of QA Projections for (XZ) Plane [red = LSO, blue = HwMuMap].png (71.9 KB)

Overlay of QA Projections for (XY) Plane [red = LSO, blue = HwMuMap].png (53.3 KB)
ImageInTableBug.pdf (139.2 KB)

@Gerd

The code snippet you shared looks incomplete as we are not able to use it as it is. Can you please share simple minimal code sample that we can use to replicate the issue in our environment and address it accordingly?

No problem, sorry for that I forgot to add my main method:
public static void Main(string[] args)
{
var license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.PDF.NET.lic”);

var doc = new Document();
var file = Path.Combine(@"c:\temp",ImageInTableBug(doc.Pages.Add()));
Console.WriteLine(file);
doc.Save(file);
Process.Start(file);

}

The images which are used are attached and have to be copied into the directory which is to be named here (please change “…” accordingly):
const string path = @“…”;

The version I’m using is Aspose.pdf 24.10.

Please let me know which open issue you found with my snippet.

@Gerd

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-59895

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.