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

[bug] ERROR: Infinite table loop #1163

Open
lpf4254302 opened this issue May 13, 2024 · 2 comments
Open

[bug] ERROR: Infinite table loop #1163

lpf4254302 opened this issue May 13, 2024 · 2 comments
Labels

Comments

@lpf4254302
Copy link

Describe the bug

there is a text "ERROR: Infinite table loop" in the last page of the pdf file, when a long text in the Cell and the Cell is higher than the Height

To Reproduce

float[] widths = {100F};
PdfPTable table = new PdfPTable(1);
table.setHorizontalAlignment(Element.ALIGN_LEFT);
table.setTotalWidth(widths);
table.setWidths(widths);
table.setLockedWidth(true);
PdfPCell cell;
Font font = FontFactory.getFont("/Users/wensibudong/IdeaProjects/testcompare/src/main/resources/font/simsun.ttc,0", BaseFont.IDENTITY_H, true);
cell = new PdfPCell();
cell.setFixedHeight(rotate.getHeight() - 20 + 1);
cell.setPaddingTop(0);
cell.setPaddingBottom(0);
cell.setPaddingLeft(0);
cell.setPaddingRight(0);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_TOP);
Paragraph phrase = new Paragraph();
phrase.setLeading(Float.NaN);
phrase.setFont(font);
String a = "13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记13、世事早已擦肩而过,我们又何必反复追忆,反复提起。是时候和昨天告别了,忘记一切,也原谅一切。是真的忘记";
phrase.add(a);
cell.getColumn().setLeading(0F, 1.2F);
cell.getColumn().addText(phrase);
table.addCell(cell);

Expected behavior

I know that,if the fixHeight > pageSize,it will happened,this error tips will make me confused

Screenshots

System

(please complete the following information)

  • OS:
  • Used font:simsun
  • OpenPDF version:1.3.34

Your real name

Pengfei Liu

Additional context

@lpf4254302 lpf4254302 added the bug label May 13, 2024
@asturio
Copy link
Member

asturio commented May 21, 2024

Seems related to #514 , but there it uses Table, not PdfPTable

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

No branches or pull requests

3 participants