HNHacker News
TopNewBestAskShowJobs

Leoko

5 karma · joined November 19, 2020

submissionscomments
Leoko··on Show HN: SeekStorm – open-source sub-millisecond search in Rust
Sub-millisecond latency sounds impressive, but isn't network latency going to overshadow these gains in most real-world scenarios?
Leoko··on Launch HN: Onedoc (YC W24) – A better way to create PDFs
Yes, page breaks are probably the most significant difference between the layout of a web page and a PDF document, and thereby a major drawback when using HTML-to-PDF. There is little to no tooling for this in the web.

If you want granular control over how your PDF will look with content that is more than one page long, you will have a hard time using html.

Leoko··on Launch HN: Onedoc (YC W24) – A better way to create PDFs
I had to deal a lot with PDF generation over the past few years and I was very unhappy with the eco-system that was available:

1. HTML-to-PDF: The web has a great layout system that works well for dynamic content. So using that seems like a good idea. BUT it is not very efficient as a lot of these libraries simply spin up a headless browser or deal with virtual doms.

2. PDF Libraries (like jsPDF): They mostly just have methods like ".text(x, y, string) which is an absolute pain to work with when building dynamic content or creating complex layouts.

This was such a pain point in various projects I worked on that I built my own library that has a component system to build dynamic layouts (like tables over multiple pages) and then computes that down to simple jsPDF commands. Giving you the best of both worlds.

Hope this makes somebody's life a bit easier: https://github.com/DevLeoko/painless-pdf

Leoko··on Ask HN: How to generate PDFs from the back end?
Generating PDFs is a pain with most libraries, especially if the content is dynamic and should span multiple pages.

If you can use NodeJS on your backend, you might want to take a look at my PDF Library: https://github.com/DevLeoko/painless-pdf