Show HN: PlutoBook – Fast, lightweight C++ library for generating PDF from HTML
a year ago
- #HTML-rendering
- #PDF-generation
- #C++
- PlutoPrint is a Python library built on PlutoBook for easy paged HTML rendering.
- PlutoBook is a robust HTML rendering library tailored for paged media, independent of Chromium, WebKit, or Gecko.
- Designed to be lightweight and memory-efficient, leveraging modern C++ features.
- Supports HTML or XML input with CSS stylesheets, rendering to Bitmap images or PDF.
- Comparison with browser-based renderers like Playwright or Puppeteer highlights PlutoBook's efficiency for static documents.
- Core API revolves around the Book class for document manipulation and rendering.
- Supports loading content from URLs, local files, and rendering to ImageCanvas or PDFCanvas.
- Viewport in PlutoBook adjusts for margins, supporting CSS viewport-relative units for responsive layouts.
- Practical applications include email client rendering, text editor integration, backend PDF generation, and e-book readers.
- Installation requires Meson and Ninja, with dependencies like Cairo, FreeType, and optional libraries for extended features.
- Licensed under MIT, encouraging contributions and commercial use.