-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
I have table capability on my long-term to-do list for PDF::Builder, but it looks like PDF::Table may do the job. There are some additional features that I would like to see, that would make it far more useful, so if anyone is looking for some small projects to contribute with, these might provide some ideas:
In HTML, the header is defined separately, defaults to bold and centered in cells, and automatically repeats. I think it should have repeat=1 by default, but since it's easy to set, it could be justified not changing. The design would have been cleaner to have a header (<thead>-like) defined separately from the body data, but I can live with it being the first data row.- HTML offers a footer (
<tfoot>), similar to the header, and PDF::Table should too. Perhaps it could be the second data line (first, if there's no header)? - There might be a code hook to dynamically define header and footer contents (such as page subtotals).
- Either provide start-of-page and end-of-page code hooks, or make a per-page call to output that page's table. This would make it easier to put out running page headers and footers, page numbers, first and last content headings (like the first and last word on a dictionary page). Some sort of hook or flag to let the program know when the first row/column and last row/column are being processed would make it easier to output page headers.
- Offer more control over splitting the table between pages: keep the table intact unless it exceeds one page (good for short tables), allow split only only between rows (unless a row exceeds one page), and some sort of splitting within a row (at a minimum, don't create orphans and widows), allow split between paragraphs, etc. CSS might give some ideas for controls.
API2 and Builder have a rotate(n) call to rotate the page, which can be useful for outputting wide tables. Page headers and footers should still be portrait mode, while the rest of the page content is rotated landscape. Unfortunately, I think you would have to (at page level) rotate(-90) and manually unrotate page headers and footers.- Consider how to use PDF::Table to output continuous text in two or three columns (of one row per page), with content output (like text blocks) automatically flowing from one column to the next. The last page of a table should permit some sort of column balancing, to even out the column lengths.
- Permit vertical alignment of cell contents (see HTML and CSS valign): top, bottom, or middle.
Define rules (internal cell separators) separately from the outside enclosing border. Generally they would be lighter weight, or even omitted. If permitting flowed columns, allow a light vertical rule in the gutter between columns. Dashed or other pattern rules could be supported.- Permit more elaborate border lines than just solid -- double lines, 3D beveled effects with shadows, etc. like HTML and CSS support.
I don't know when I'll have time to get to any of these, but hopefully if someone is looking for something to do, this will give some ideas (clear them with the owner first, before spending a lot of time coding!). I'll be happy to elaborate offline on what I'm looking for in a specific item, if you're not sure what I'm asking for.