OnePagePerSheet PDF conversion sometimes cutting off last row

I’m trying to convert this file to PDF, with the OnePagePerSheet option set to true:

12k rows.xlsx.zip (31.5 KB)

With E4000 as the bottom right, all 4000 rows are included:

image.jpg (166.0 KB)

With E5000, the last row is not included (note how the row is visible in Excel but not in the PDF):

image.jpg (160.0 KB)

When the print area is A1:E4537 (or fewer rows), then all rows are included, however with A1:E4538 (or more rows), then the final row is cut off.

If I set OnePagePerSheet back to false, then the data is included, so it seems to be an issue with OnePagePerSheet.

image.jpg (161.6 KB)

Any ideas what could be going on here?

@jrf.att
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): CELLSNET-53368

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.

@jrf.att

The output pdf is OK with the lastest version Aspose.Cells for .NET 23.5(Download | Nuget) :CELLSNET-53368_Cs.pdf (122.2 KB)
Screenshot_page_content.png (37.5 KB)

Also, please open the pdf file with Adobe Reader in case that other tools may not support well for the pdf with large dimension page size.

Hey @peyton.xu,

I’m able to reproduce the issue on 23.5 by setting the margins to 0:

pageSetup.TopMargin = 0;
pageSetup.BottomMargin = 0;
pageSetup.LeftMargin = 0;
pageSetup.RightMargin = 0;

With a print area of A1:A5000, I see the following in Acrobat Reader:

image.jpg (312.3 KB)

If I set BottomMargin to 0.2, the 5000’th row becomes partly visible:

image.jpg (319.5 KB)

@jrf.att

We can reproduce the issue after setting margin to 0, and log it in our inernal issue tracking system.
You will be notified when there are some progress.

@jrf.att,

This is to inform you that your issue has been resolved now. The fix will be included in our upcoming release (Aspose.Cells v23.6) that we plan to release in the first half of June 2023. You will be notified when the next version is released.

Awesome, thanks @amjad.sahi!

@jrf.att,
You are welcome.

The issues you have found earlier (filed as CELLSNET-53368) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Hi all,

Thanks for the update, and apologies for the slow response.

I’ve tested the new release and confirmed it works up until about 9000 rows. Above that, and the rows begin to be cut off again. See Screenshot 2023-07-10 at 1.24.46 pm.jpg (317.5 KB), where I’ve updated the file from the original post to go up to 10000 rows, then set a print area going to E10000.

Is there an expected limit to the number of rows for OnePagePerSheet?

Thanks,
James

@jrf.att,

Thanks for the screenshot.

Well, we cannot guarantee that it will work for all scenarios/cases, there cannot be hard and fast rule for it. I tested with the latest version using your original scenario with your original file and following sample code, it works fine and as expected:
e.g.
Sample code:

            Workbook wb = new Workbook("12k rows.xlsx");

            PageSetup pageSetup = wb.Worksheets[0].PageSetup;

            pageSetup.PrintArea = "A1:E5000";
            pageSetup.TopMargin = 0;
            pageSetup.BottomMargin = 0;
            pageSetup.LeftMargin = 0;
            pageSetup.RightMargin = 0;

            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
            pdfSaveOptions.OnePagePerSheet= true;

            wb.Save("CELLSNET-53368_Cs.pdf", pdfSaveOptions);

Please find attached the output PDF file for your reference.
CELLSNET-53368_Cs.pdf (141.3 KB)

Could you share your input (updated) Excel file, sample code and output PDF for reference, we can check it.

Well, it depends upon font and its glyph, number of data cols which may vary from other attributes. To squeeze huge list of data in single page is challenging and cannot be always possible, so you should accommodate it and minimize records for it accordingly.

Thanks @amjad.sahi, understood there’s no guarantees. I was more curious if you had any guidance based on real-world experience. For what it’s worth, we had a user upload an Excel file with 200,000+ rows (which obviously doesn’t fit nicely into a single page PDF!), so we’re fine introducing some limit, it’s just a question of what that limit should be.

I’ve attached an updated Excel file and the output PDF:

CELLSNET-53368_10k-rows.zip (175.4 KB)

The sample code is the same as what you have above, except that the print area is A1:E10000.

@jrf.att
Through testing, we can reproduce the issue where the content in printarea could not be exported properly when exporting the file to PDF.
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): CELLSNET-53724

@jrf.att,

This is to inform you your issue (logged earlier as “CELLSNET-53724”) has been resolved. The fix will be included in our upcoming release (Aspose.Cells v23.8) that we plan to release in the first half of August 2023. You will be notified when the next version is released.

The issues you have found earlier (filed as CELLSNET-53724) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi