
A PDF generator for Rails using Ferrum & headless Chrome
FerrumPdf is an innovative solution designed for Ruby on Rails developers who need to generate PDFs and screenshots seamlessly using headless Chrome, without the hassle of Node.js or Puppeteer dependencies. This gem simplifies the process, allowing for easy rendering directly from Rails controllers. With FerrumPdf, you can convert HTML templates or URLs into beautifully formatted PDFs and snapshots, making it a valuable tool for creating reports, invoices, or capturing web content on the fly.
The functionality is wrapped in a familiar Rails API, ensuring developers can quickly integrate it into their projects. The configuration options offer a robust way to customize page layouts, headers, footers, and general browser settings, catering to a wide array of use cases from simple screenshots to complex document generation.
PDF Rendering: Easily render PDFs from HTML or URLs directly from Rails actions using built-in renderers.
Screenshot Capture: Capture screenshots of web pages or HTML content with minimal setup, supporting desired layouts and customization.
Customization Options: Configure default settings for page loads, PDF, and screenshot renders through a dedicated configure block for maximum flexibility.
Thread Safety: Operates safely within a single Ruby process, allowing multiple threads to share the same Chrome browser instance.
Debugging Support: Enables debugging with non-headless Chrome or through custom blocks, giving access to the page and browser objects for troubleshooting.
Single Browser Instance: Manages a single Chrome instance per Ruby process for efficiency, while supporting custom browser instances if necessary.
Docker Compatibility: Designed to work seamlessly within Docker, with recommended security options to ensure safe operations in production environments.
