https://github.com/rubyonworld/pdftotext
You must first install Poppler. On OS X this can be done with brew install poppler if you have Homebrew installed
https://github.com/rubyonworld/pdftotext
convert os pdf ruby text
Last synced: 8 months ago
JSON representation
You must first install Poppler. On OS X this can be done with brew install poppler if you have Homebrew installed
- Host: GitHub
- URL: https://github.com/rubyonworld/pdftotext
- Owner: RubyOnWorld
- License: mit
- Created: 2022-09-23T02:45:44.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-23T02:45:59.000Z (almost 4 years ago)
- Last Synced: 2024-12-28T14:26:18.934Z (over 1 year ago)
- Topics: convert, os, pdf, ruby, text
- Language: Ruby
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Pdftotext
*A Ruby wrapper for the `pdftotext` command line library*
[](https://travis-ci.org/benbalter/pdftotext)
## Installation
1. You must first install [Poppler](http://poppler.freedesktop.org/). On OS X this can be done with `brew install poppler` if you have Homebrew installed
2. Add `gem "pdftotext"` to your project's Gemfile
3. `bundle install`
## Usage
```ruby
text = Pdftotext.text('path-to.pdf')
=> "The text of the PDF"
pages = Pdftotext.pages('path-to.pdf')
pages.first.number
=> 1
pages.first.text
=> "The text of the PDF"
```
Both methods take an optional hash of command line arguments to pass to `pdftotext`. The only one by default being `-layout`.