jorisschellekens / borb

borb is a library for reading, creating and manipulating PDF files in python.
https://borbpdf.com/
Other
3.4k stars 147 forks source link

Feature: Add support for table headers #201

Closed siancu closed 8 months ago

siancu commented 8 months ago

It would be nice if it would be possible to add a table header which will then be repeated if subsequent pages if the table is too long.

Ideally the header would be flexible, i.e. you could add an arbitrary number of rows to the header, but I would be happy also with one row for the header.

jorisschellekens commented 8 months ago

TI think you are more than capable of implementing this yourself.

The general idea would be:

  1. Create a subclass of FixedColumnWidthTable (or FlexibleColumnWidthTable). This custom subclass keep track of what the header cells are.
  2. Create a subclass of SingleColumnLayoutWithOverflow, and implement your own method for splitting an instance of your newly created (see step 1) Table. This split-function should mostly work like the method that already exists, but repeat the header in the second part of the split.

Kind regards, Joris Schellekens