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

headerrow not added. #277

Open
Neogene opened this issue Mar 3, 2024 · 0 comments
Open

headerrow not added. #277

Neogene opened this issue Mar 3, 2024 · 0 comments

Comments

@Neogene
Copy link

Neogene commented Mar 3, 2024

Hi, i created the following code, the header row isn't added, i checked also with a pdf inspector and the first object added is the next row but not the header (i used iText RUPS to check the pdf structure).

`float yStartNewPage = page.getMediaBox().getHeight() - (2 * margin);
float tableWidth = page.getMediaBox().getWidth() - (2 * margin);
boolean drawContent = true;

                    BaseTable table = new BaseTable(startY, yStartNewPage, margin, tableWidth, margin, document, page, true, drawContent);

//NOT ADDED
Row headerRow = table.createRow(50);
headerRow.setHeaderRow(true);
Cell cell = headerRow.createCell(100, "HEADER");
cell.setFontSize(12);
cell.setValign(VerticalAlignment.MIDDLE);
table.addHeaderRow(headerRow);

                    Row<PDPage> interventionAreaRow = table.createRow(50);
                    Cell<PDPage> interventionAreaCell = interventionAreaRow.createCell(100, "Block");
                    interventionAreaCell.setFontSize(10);
                    interventionAreaCell.setTextColor(Color.darkGray);
                    interventionAreaCell.setValign(VerticalAlignment.MIDDLE);
                    table.draw();

//Editable field ADDED

                     startY = startY-30f;

                    String desc = "field text";
                    addTextBox(acroForm, document, page, "TextBox", desc, startX, startY, tableWidth, 160);

                    page =  checkStartY(document, page, 20f);`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant