HackerTrans
TopNewTrendsCommentsPastAskShowJobs

sammycage

no profile record

Submissions

Show HN: PlutoPrint v0.11.0 released with many new features

pypi.org
1 points·by sammycage·8 mesi fa·0 comments

Show HN: PlutoPrint – Generate PDFs and PNGs from HTML with Python

github.com
161 points·by sammycage·11 mesi fa·49 comments

Show HN: PlutoPrint – Generate Beautiful PDFs and PNGs from HTML with Python

github.com
3 points·by sammycage·11 mesi fa·0 comments

Show HN: LunaSVG – C++ Library for Rendering and Manipulating SVG Documents

github.com
5 points·by sammycage·12 mesi fa·0 comments

Show HN: PlutoFilter- A single-header, zero-allocation image filter library in C

github.com
79 points·by sammycage·anno scorso·16 comments

[untitled]

1 points·by sammycage·anno scorso·0 comments

[untitled]

1 points·by sammycage·anno scorso·0 comments

[untitled]

1 points·by sammycage·anno scorso·0 comments

Show HN: PlutoBook – Fast, lightweight C++ library for generating PDF from HTML

github.com
11 points·by sammycage·anno scorso·2 comments

comments

sammycage
·11 mesi fa·discuss
Thanks for your questions!

1. The documentation for HTML and CSS parsers is pretty straightforward and easier to implement, so I thought it was better to write them myself.

2. It fully supports margin boxes (headers and footers) using properties like @top-left and @bottom-center inside @page rules. You can see more here: https://github.com/plutoprint/plutobook/blob/main/FEATURES.m...

3. Yes, I did come across this. Fragmentation logic is as difficult as it sounds. Right now PlutoBook works with a single, consistent page size throughout a document and does not support named pages, which simplifies things a lot.

Feel free to contact me via email if you have more questions.
sammycage
·11 mesi fa·discuss
Thank you for your kind words and for noticing the work behind this. Building an HTML and CSS rendering engine has been a long journey with many surprises. I have been maintaining https://github.com/sammycage/lunasvg for years, so I was familiar with interpreting specs and rendering engines. That experience gave me the confidence to tackle HTML.

At first, my plan was simple. I wanted to make an HTML rendering library. But soon, I realized it could be even more useful if it focused on paged output so I could make PDFs directly. C and C++ do not have an HTML-to-PDF library that is not a full web engine. I started coding and thought I could finish in a year by working a few hours each day. But reality came fast. HTML and CSS are much harder than SVG, and even small things caused big problems.

I studied KHTML and WebKit to see how real HTML and CSS engines work. The official specs were very helpful. Slowly, everything started to come together. It felt like discovering a hidden world behind the web pages we see every day.

The hardest part has been TableLayout. Tables look simple, but handling row and column spans, nested tables, alignment, page breaks, and box calculations was very hard. I spent many hours fixing layout bugs that only appeared in some situations. It was frustrating, humbling, and also very satisfying when it worked.

I am still learning and improving. I hope other people enjoy PlutoPrint and PlutoBook as much as I do.
sammycage
·11 mesi fa·discuss
Hi! We haven’t specifically tested Colab notebooks. They’re tricky because of dynamic layouts and tables, but simpler notebook exports to HTML might work better. Any feedback or test cases would be super helpful to improve support.
sammycage
·11 mesi fa·discuss
Typst and PlutoPrint serve somewhat different purposes. Typst is more like a modern typesetting language, focusing on fully programmatic document layouts with its own syntax, while PlutoPrint is a Python library built on a C++ rendering engine that converts HTML or XML into PDFs and PNGs. PlutoPrint’s strengths are fast rendering, strong SVG support, and integration with existing Python workflows, whereas Typst is great if you want a typesetting DSL with precise layout control from the ground up.
sammycage
·11 mesi fa·discuss
Interesting. I will give it a try. By the way, why is converting to HTML first a problem for you?
sammycage
·11 mesi fa·discuss
PlutoPrint supports a large subset of CSS, including flexbox for most common layouts, but it’s not a full browser engine, so there are some limitations. You can see a more complete list of supported features here: https://github.com/plutoprint/plutobook/blob/main/FEATURES.m.... We’re also actively tracking bugs and improvements on the GitHub repo: https://github.com/plutoprint/plutoprint/issues, and contributions or test cases are always appreciated to help expand coverage.
sammycage
·11 mesi fa·discuss
Thanks for the feedback. We’ve tested PlutoPrint on multiple platforms, including Windows and Linux, and it generally works well there. Mac-specific issues like crashes or empty outputs are definitely on our radar, and we’re investigating potential causes such as font handling, reverse mtime warnings, or system library differences. We’re also tracking bugs and improvements on the GitHub repo: https://github.com/plutoprint/plutoprint/issues. Contributions, bug reports, and additional test results from different environments are very helpful and appreciated as we continue to improve stability across all platforms.
sammycage
·11 mesi fa·discuss
That’s a good point. Using Puppeteer or a headless browser gives you essentially full web platform support. The tradeoff is that it comes with a heavier runtime and more moving parts (Chromium, Node, etc.). PlutoPrint aims to be much lighter: no browser dependency, just a compact C++ engine with a Python wrapper. It does not cover the entire browser feature set but it is fast, portable, and easy to drop into projects without the overhead of a full browser.
sammycage
·11 mesi fa·discuss
WeasyPrint is great, but PlutoPrint takes a different angle: the engine is all C++, so it’s faster and lighter on memory. It can render directly to PNG as well as PDF, and has stronger SVG support.
sammycage
·anno scorso·discuss
Clean, thoughtful, and practical. Curious, have you tried benchmarking your Haskell solver against an SMT solver (like Z3 or CVC5) to compare performance or expressiveness?
sammycage
·anno scorso·discuss
I feel this so much. File IO on flaky or network drives is a nightmare, and blocking calls make it worse. It’s good to see the async iterator and substring search moving forward, though it still feels a bit fragile with the thread workaround.

One thing I wonder is how you plan to handle cases where files vanish or change mid‑operation. Will the API just bubble up errors, or do you plan to hide some of that under retries or caching?

Overall, really enjoying these devlogs. Seeing the tradeoffs laid out like this is helpful for anyone building similar tools. Keep it up.
sammycage
·anno scorso·discuss
Nice breakdown. Seeing each core as its own machine passing messages through cache lines makes the usual atomic patterns much easier to reason about. This mindset also explains why misuse of atomics can kill performance when you forget how caches talk to each other. Good mental model, bookmarked for future reference.
sammycage
·anno scorso·discuss
[dead]
sammycage
·anno scorso·discuss
I appreciate Lanier’s reminder that AI is ultimately a collective artifact, not an independent mind. Calling it "large language social collaboration" might be clunky, but the point is fair: what we label "AI" is just our accumulated digital patterns, recombined.

I do wonder, though. At what point does the remixing and generalization become more than just a mirror of us? Even if it is still trained on human work, its behavior can surprise us in ways that feel alien.

Curious if others here agree: is the term "AI" just marketing hype, or is it still useful shorthand for systems whose emergent properties we do not fully control?
sammycage
·anno scorso·discuss
[dead]