[GNC-dev] WebKitGtk now defaults to Gtk4

Adrien Monteleone adrien.monteleone at lusfiber.net
Tue Nov 21 09:55:03 EST 2023


Thanks John,

If the internal links are indeed possible, I'd think HTML to the browser 
would be the way to go. As David noted, if someone wants a PDF, they can 
save it from there.

But all is not lost with respect to a direct PDF export. That might be 
possible by first generating the HTML, but instead of sending it to the 
Browser for viewing, run it through one of the following first, then to 
disk:

1. https://ekoopmans.github.io/html2pdf.js/
2. https://github.com/spipu/html2pdf/

(the first seems a bit more robust and less limited than the second)

Regards,
Adrien

On 11/20/23 9:35 PM, john wrote:
> Sending the HTML to the browser is easy. Writing the reports in PDF directly requires a complete rewrite of the report output code that's hardwired to generate HTML using basic scheme text output, plus replacing the javascript-based charts solution with some other library that generates PostScript vector graphics (https://graphviz.org <https://graphvizorg/> comes to mind). That's a pretty big rewrite, probably a solid year of work for an experienced developer with lots of available time and assuming that there's a suitable library to abstract generating the PDF boilerplate.
> 
> The reason using the web browser to display the html loses the transaction/account links is because they're implemented using a callback function that we can register with WebKitWebViewGtk. That goes away when the browser isn't part of GnuCash. It's not impossible, of course: It should be possible to embed a bit of javascript that calls back to GnuCash on a (new) socket listener that would do the linked action.



More information about the gnucash-devel mailing list