https://github.com/ivaldi/postdoc
Generate PDF files from Ruby with headless Chrome/Chromium from Ruby
https://github.com/ivaldi/postdoc
html pdf ruby
Last synced: 4 months ago
JSON representation
Generate PDF files from Ruby with headless Chrome/Chromium from Ruby
- Host: GitHub
- URL: https://github.com/ivaldi/postdoc
- Owner: ivaldi
- License: bsd-2-clause
- Created: 2017-12-05T09:42:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-06-29T22:29:10.000Z (almost 3 years ago)
- Last Synced: 2025-10-08T02:48:06.549Z (9 months ago)
- Topics: html, pdf, ruby
- Language: Ruby
- Homepage:
- Size: 79.1 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Welcome to Postdoc.
This gem was build to convert HTML data into PDF documents. This is handy because Rails is much better at building HTML document than at building PDF documents.
## Usage
Add the following line to your gemfile
```ruby
gem 'postdoc'
```
And install it
```sh
bundle install
```
Now you can render a pdf from a string that contains the data from a HTML file in the following way:
## Handy links:
- [ChromeRemote](https://github.com/cavalle/chrome_remote) is gives us a client to talk to chrome.
## Handy commands:
```sh
# Run tests.
rake test
# Generate a test pdf. Usefull for debugging purposes.
bin/run_with_website
```
## Known issues:
For Mac users with an `No such file or directory - chrome` exception, use the following command from the root folder of this repository.
```
cp bin/chrome /usr/local/bin/chrome
```
## TODO
Refactor all instances of string to stringIO for better future interop with
files.