Big differences between PDF page and preview/Print button page

Update: We just found the holy grail for better prints.

Split Print Format table automatically into pages based on rendered size.

Using our custom app’s jinja function, we are now able to split the table rows according to a given “max-size” per page, taking print format styles into account. You just pass the whole table html and will get a paginated version back. Easy as that.

We’re still finishing everything up and are planning to make it public. Might be our contribution to the frappe community :slight_smile: :fireworks:

1 Like

hi, I am waiting for your solution
Will it include difference in the cell height in PDF and print too? If I use PDF button the cell height is very high, with bigger font

Hi @auliabismar
We’re still planning on releasing it for public - but there’s a lot to do for a stable release.

There won’t be any differences between preview and actual print. If you set the css accordingly, you will be able to specify any cell height/padding.

So far, our solution will be released approx. around February/march and will be mainly focused on jinja print formats.

Update: We’re on track and able to release a first beta version by mid/end of February. After discovering an even better solution, we switched over and got a pretty awesome app now with lots of improvements over the standard print formats.

Waiting…

Quick update for all those waiting, as the first beta will be delayed a little: In favor of stability & reliability, we replaced one underlying library with a custom-made. This will delay the first beta to approx. mid of April, but will add further simplicity as well.
So… good things take time.

New Chrome Headless is now available for testing locally in develop version :tada: ( FC support is pending ). feat: Chrome PDF Generator by maharshivpatel · Pull Request #399 · frappe/print_designer · GitHub

1 Like

Hi @Maharshi_Patel
Thank you, great news for all users of Print designer and it’s future (which is definitelly very promising) :slight_smile: .

Our solution will provide a different, more Jinja oriented approach:

  • Free control over content with jinja and full html/css support
  • Printpreview 1:1 identical look to the final PDF (preview is rendered clientside, therefore more performant)
  • Dynamic header/footer
  • Custom page formats

I know Print Designer does fullfill a lot of those needs, but still not all. This was the initial reason for our custom app. However, I’d love to see them implemented in Print Designer too in the future :slight_smile:

@neocode what i shared is new pdf generation backend for frappe ( not limited to print_designer ). It’s uses Chrome headless rendering. i shared this as you earlier mentioned it in the post. Thank you.

Ah, I see. Thank you :slight_smile:

Does your solution work on version 14? If so, I am really looking forward to it.

Interesting.

Is it released?

almost… a first alpha release should be ready this week - stay tuned :slight_smile:

(There were some unexpected issues, which made the final app even better in the end)

So there we are…

…after over 298 commits across 3 repos, I’m proudly presenting the first early-alpha release of Frappe Betterprint

You might as well take a look into the docs

Please note, it’s an early-alpha release - so expect breaking changes!

A quick overview of the features:

  • Universal Layout: Preview/Printview/PDF - they look just the same.
  • Full, modern CSS support: Flexbox, W3C standards - all printed with headless Chromium.
  • Individual page size per Print Format: Independent PDF size :smile:
  • Preview & support for any page size (even A0 or larger page size is supported)
  • Dynamic Headers & Footers: Apply different content per Page, add running numbers e.G.
  • Parallel use of regular Print Formats and Print Designer possible
  • better_page_break() Jinja function for quick & easy page-breaks
  • [comin soon] Page ranges: Add different styles to parts of your page
  • [comin soon] PDF-worker to generate PDFs even faster

What’s next?

I’m hoping to get some feedback from early tester - feel free to open an issue or submit a commit or feature request on our github repo GitHub - neocode-it/frappe_betterprint: Frappe app with advanced print functions or reply with any kind of questions & feedback to this message.

We’ll keep going to make frappe_betterprint even better to it’s first release. Keeping you updated. (One might as well give the repo a star and watch for releases on Github)

6 Likes

It will be only Frappe v15 onwards…

Thanks for your conyribution. Does it support the concept of page footer and last page footer?

So far we have been trying with all solutions exists in frappe and the control of footer is still a challenge.

Thanks

It does support repeating page footer/header with dynamic content (Add different text on page 1, 2).

In the future, you will have page ranges…which will allow you to specify different footer styles (& height) for all pages following the definition within the content.

However, addressing the last footer specific is a hard thing by design: If there’s not enough space for the footer, the footer has to be on the next page… but then, there will be a lot of empty space on the last and second last page.

Other solutions which will be possible with Frappe Betterprint:

  • Add a new page range (e.g. “last-page”) → this will create a (optional) page-break and allow to set a new layout (different footer height) for all following pages.
  • Keep all footer the same height and just add a completely different footer content to the last page (absolutely possible).
  • Hacky, but working: You can add your last footer content at the end of the page content and align it to the bottom (margin-top: auto; or align-self: flex-end;). Please note, this will only align it above the footer → it’s recommended to set the footer height to 0.

Is there any page/link where we can report bugs for Frappe Betterprint?

Yes, Feedback & Bug reports are highly appreciated. You can open an issue on GitHub: GitHub · Where software is built

Thank you for your help in making Frappe Betterprint a stable first release :slight_smile:

If you need help, feel free to send me a private message.