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

proposal to add 'hard tables' mode, which throws an error rather than overflow a table cell of known height #2345

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adamwong246
Copy link

For your consideration: a (Work In Progress) proposal to add a feature required by our team.

background

We are printing grids of labels and we use pdfmake to achieve that by dynamically generating tables that fit the label-sheets. We need to reliably print "within the lines", without the need for a visual inspection. The task is made more difficult because the content within each of the thousands of labels is unique.

before

When you give a table cell a known height, this height will only apply if the content fits within. If the content exceeds the capacity of the cell, this height is ignored and the cell simply gets larger. This forces our team to visually inspect documents with diff-pdf, which is a huge pain-point.

after

This feature extends the LayoutBuilder with an extra mode, which we call "hard table mode". When enabled, the layout builder will throw an error rather than overflow a table cell of a known height. If a table cell is unable to fit its content, an error is thrown.

future work

We're also interested in extending this mode to work in the horizontal direction- that is, throw an error if the content of a column of a fixed width is too wide.

We'd prefer not to maintain a fork and thus we'd like y'all to review it and give us some feedback. I had taken care to keep the structure and format of your codebase, though it appears my editor has pretty-fied more than I had intended. Of course I'll try to clean that up later.

🙏

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

Successfully merging this pull request may close these issues.

1 participant