Lurker News

Comments (265) 53 threads

Earlier comments
synergy201 reply#
PDF is elegant on my eyes. To make it a web surfing experience for me it lacks one thing here, that I need the TOC on the left or right side so I can click and jump to various section quickly.
abhinav221 reply#
The table of contents is itself hyperlinked. And at the bottom of each page is a link to return to the table of contents.

Let me know if that works well?

synergy201 reply#
yes that helps a lot, a toc on the side will be even better but toc hyperlink is good enough for now. Thanks!
abhinav22#
Thanks!
hu34 replies#
Are there any report generation libraries built on top of page.js?

I've been looking for report generation solution based on frontend technology.
Btw. This is great. Thanks for sharing.

adamjhyde#
In case you missed it, pagedown implements pagedjs afaik
abhinav221 reply#
Thanks for your kind words.

Would you be able to expand on what you mean by “report generation libraries”?
For example, I am building (in Common Lisp, but it’s trivial and can be done in any software) a tool to read content from a database and auto generate the HTML markup for producing pdf reports. This allows me to reuse content across reports and also leverage the full power of databases (text search in particular). As another example, I have many monthly financial metrics - I will store these in a database then use my lisp markup tool to generate the necessary HTML to produce the pdf report (via paged.js).
In addition, one can use headless chrome to automate the full workflow so that the reports are generated directly from your program and not via File > Print in your browser.
Was that what you were thinking of?
You can also add charts via charts.js.
The beauty of paged.js is that you can leverage many of the features of browsers and JavaScript libraries in your report generation.
I wasn’t able to get syntax highlighting for code blocks to work however, need to dig into that a bit more.

hu3#
> Was that what you were thinking of?

Yes! This is great. Thanks for the pointers. I'll look into that.

dreix#
I started generating PDF before pagedjs and use my own electron based solution. Search for schild.report on github to see how it works. Basically reports are created via svelte templates and then printed via the electron print api. Works extremely well.
aforwardslash#
I've built a python library called ZipReport to manage and generate PDF reports from HTML using paged.js - https://github.com/zipreport

The actual PDF generation component is an electron application, so it may fit your "frontend technology" requirement.

axlee1 reply#
What is your favourite library for printing HTML to PDF?
papa_bear1 reply#
Can anyone speak to how this compares with something like wkhtmltopdf? That's what I've been using, and this is my first time hearing about PrinceXML too.

I generate some HTML for the user, they can edit it with a rich text editor like TinyMCE, and then we export to PDF on the server side. Wkhtmltopdf is pretty barebones on the style/feature side though, so this looks worth investigating.

abhinav221 reply#
From my limited experience with wkhtmltopdf, a solution based on paged.js should work better

But maybe that’s because I didn’t fully learn wkhtmltopdf
PrinceXML is very good but is a paid solution. I found paged.js, at least for my purposes, on par with PrinceXML

papa_bear#
Interesting, thanks for the input!

Load more comments