1

In Adobe Acrobat Pro DC, I have created a PDF document with a header and footer. I'm using PDFBox and Boxable to put a table between the header and footer. This works on the first page of the document. But, when my Boxable table spans several pages, the header and footer only appear on the first page. They are absent from the second page, third page, etc.

I'm using this PageContentStream constructor:

PDPageContentStream contentStream = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.PREPEND, false, true);

Below is how I'm loading the template file and creating the table. Thanks!

File pdfFile = pdfUtil.getPdfFile("pdf/table.pdf");
PDDocument document = PDDocument.load(pdfFile);
PDPage page = document.getPage(0);
PDPageContentStream contentStream = new PDPageContentStream(document, page, PDPageContentStream.AppendMode.PREPEND, false, true);

// Some code here to set variables

BaseTable table = new BaseTable(yPosition, yStartNewPage, bottomMargin, tableWidth, margin, document, page, true, drawContent);
Chris Williams
  • 11,647
  • 15
  • 60
  • 97
rogeop
  • 11
  • 1

0 Answers0