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
feat: New Print Format Builder #14134
feat: New Print Format Builder #14134
Conversation
- Print Format Builder Beta page - Add margin fields in Print Format - Using vuedraggable for drag and drop
- Show selection dialog if Print Format not selected - Field component - Common store - Edit Field label inline - Configure table columns - Edit Custom HTML - Preview
- /printpreview route to preview HTML template
Codecov Report
@@ Coverage Diff @@
## develop #14134 +/- ##
===========================================
+ Coverage 49.72% 50.28% +0.56%
===========================================
Files 744 747 +3
Lines 65023 65367 +344
Branches 5435 5460 +25
===========================================
+ Hits 32332 32872 +540
+ Misses 28720 28603 -117
+ Partials 3971 3892 -79
Flags with carried forward coverage won't be shown. Click here to find out more. |
- Letterhead editing - Edit Header and Footer - Margin Text - PrintFormatGenerator class handles generation of HTML and PDF and repeating of Header/Footer - Simplify /printpreview - Separate renderer files for each fieldtype
d5f7e87
to
f4bd62c
Compare
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing. |
- Image resize and align
@netchampfaris What's the update on this? Is this ready for QA testing for basic/core functionalities? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@netchampfaris Nice enhancements overall 👍
Noticed a few things that can be fixed.
-
These icons are confusing because in form view it signifies "Print" and "Refresh"… most people will not try to click on these for “Preview” and “Reset". Suggestion: Add text to the button -
Changing these options should update the preview in real-time (at least for HTML preview). The preview feature shines while tweaking such variables. (We can skip this if this requires major changes or if there are performance concerns)
Let's skip the documentation for now (to avoid docs for namesake). I have created a backlog to ensure the documentation and tests are added by next month. |
Co-authored-by: gavin <gavin18d@gmail.com>
@Mergifyio update |
✅ Branch has been successfully updated |
@Mergifyio update |
✅ Branch has been successfully updated |
- CSS variables in svg don't work in PDF - styling is done via external css now to make it work in form as well as PDF
Refactor of Print Format Builder has been long overdue. This PR tries to fix the culmination of all the frustrations I have had with the current PFB.
Features
Why weasyprint?
wkhtmltopdf uses a really old version of WebKit which doesn't even support standard flexbox implementation. This is the primary reason why I decided to look for an alternative. wkhtmltopdf's status page basically says that there is no promise that it will be updated to the latest WebKit engine.
However, weasyprint does not only fix the flexbox problem, it implements standard W3C CSS specifications, which means there is a standard feature to add page numbers in a PDF rather than a JS hack. Not only this, there is whole bunch of standard CSS features that allow you to customize a PDF. This was an exciting discovery.
Demo
The new Print Format Builder works alongside the current one with a feature flag in the Print Format document. So it does not break existing formats and is opt-in for now.
Show GIF
Installation
weasyprint is a pure python package but it depends on a few libraries. Follow the installation instructions at weasyprint installation page
For macOS users, simple run:
ToDo