Repository navigation
Implement N-up label printing - #995
d-buchmann wants to merge 14 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #995 +/- ##
============================================
+ Coverage 62.39% 62.75% +0.35%
- Complexity 9879 9897 +18
============================================
Files 736 736
Lines 31779 31852 +73
============================================
+ Hits 19829 19988 +159
+ Misses 11950 11864 -86 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I would benefit a lot from this PR getting merged. What do you think @jbtronics ? |
Improve naming and last row completion. But I introduced a regression that prevents me from printing more than one page. Sorry, not ready yet :/
8e6bec6 to
081fe54
Compare
Now it should be much more consistent and maintainable. - Reduce skip count modulo full pages - Set up associative arrays for header and trailer with key = index, value = null - Merge header, content and trailer - Loop through the resulting array, only adding row handling and pagination Found the bug that made page breaks fail sometimes: a missing closing div...
ae493a2 to
daf6335
Compare
|
Thanks for starting this, printing whole A4 sheets of labels is something I've wanted for a while! I built a few things on top of your branch and opened them as a PR against it: d-buchmann#4
Each part is its own commit, so feel free to take any or none of it. Since there are now several migrations, I'm happy to merge them into a single one with yours if you decide to take the changes. |
…eets (#4) Replace the CSS-based N-up grid with exact sheet geometry: page size, margins to the first label and horizontal/vertical pitch, so labels land on the pre-cut positions of office label sheets. The placement logic moves from the Twig template into LabelHTMLGenerator. Add a built-in catalog of common A4 and US Letter sheets (Avery, Avery Zweckform, HERMA) in config/label_sheets.yaml, selectable in the label generator and the label profile. Custom sheets keep working; a sheet size or pitch of 0 is derived from the label size. All label profile columns (grid, sheet, geometry) are added in a single migration. Document label sheets in docs/usage/labels.md.
|
@z3ugma would you consider another review? Code changed substantially under the hood, while maintaining and improving the proposed functionality. |
Make label printing more flexible by allowing to put multiple labels onto a single PDF page in a grid ("N-up printing").
This way you can use e.g. A4 sheets with pre-cut labels and print them in your household inkjet/laser printer - no need for a special label printer.
The grid of the sheet is set by
xcountandycountwhich I added to the form(but not yet to the database).You can also set a
skipcountwhich skips the given number of labels in case you have partly printed sheets from previous prints (feature as described/requested in #577).The size and position tweaking can be done in the additional css to fit any label sheet type.
As far as I have tested, it doesn't break the original behavior using the default values
xcount=ycount=1, skipcount=0.Currently, only translations are yet to be added.