Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Row Content Splitting in PdfPTable.writeSelectedRows() #1168

Open
HemaSudha1498 opened this issue May 24, 2024 · 3 comments
Open

Handling Row Content Splitting in PdfPTable.writeSelectedRows() #1168

HemaSudha1498 opened this issue May 24, 2024 · 3 comments

Comments

@HemaSudha1498
Copy link

Hello,

In PdfPTable, we have support to write tables in two ways:

  1. document.add(table);
  2. table.writeSelectedRows();

In the first approach, if a table row's content is too long to fit on a single page, the content is properly split across multiple pages. However, the same handling is not available in the second approach leading to data loss.

Can someone guide me on how to achieve the similar behavior in the second approach?
Or, please navigate me to the respective code logic that handles this behavior in the first approach.

PDF via document.add(table);
Screenshot from 2024-05-24 12-57-32

PDF via table.writeSelectedRows();
Screenshot from 2024-05-24 12-57-44

Thank you!

@asturio
Copy link
Member

asturio commented May 27, 2024

Nice one.
And if using Table (not PdfPTable) then you will get an endless loop.

@asturio
Copy link
Member

asturio commented May 27, 2024

Related to #1163 and #1021

@HemaSudha1498
Copy link
Author

Hi @asturio,

Thank you for your response. However, using Table does not meet my requirements. My use case involves multi-lingual text, images, icons, symbols, and shapes within a table cell. Therefore, I am utilizing PdfPTable.

I am handling large datasets, including hundreds of thousands of rows, which makes it impractical to hold all chunks, phrases, PdfPCells, and rows in the JVM. To manage this, I am using PdfPTable.writeSelectedRows() to write the table row by row.

Additionally, I need to position my table at a specific positionX and start from a particular positionY within a specified width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants