https://github.com/motdotla/carve
Convert PDFs into an array of PNGs. Takes a url of a PDF and converts its pages into individual PNGs.
https://github.com/motdotla/carve
Last synced: 7 months ago
JSON representation
Convert PDFs into an array of PNGs. Takes a url of a PDF and converts its pages into individual PNGs.
- Host: GitHub
- URL: https://github.com/motdotla/carve
- Owner: motdotla
- Created: 2014-04-17T04:12:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-13T06:26:30.000Z (about 11 years ago)
- Last Synced: 2025-01-24T05:09:34.858Z (9 months ago)
- Language: Go
- Homepage:
- Size: 848 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# carve
Convert PDFs into an array of PNGs. Takes a url of a PDF and converts its pages into individual PNGs.
Word documents are planned in the future.
[](https://travis-ci.org/motdotla/carve)
## Usage
```Go
package mainimport (
"fmt"
carve "github.com/motdotla/carve"
)func main() {
pngs, err := carve.Convert("http://some-url.com/path-to-file.pdf", "/local/path/to/output/dir")
if err != nil {
fmt.Println(err)
}fmt.Println(pngs)
}
```The output of pngs is a string of comma separated values of the path to the pngs. For example:
```
./tmp/01guest.pdf-pngs/1.png,./tmp/01guest.pdf-pngs/10.png,./tmp/01guest.pdf-pngs/11.png,./tmp/01guest.pdf-pngs/12.png,./tmp/01guest.pdf-pngs/13.png,./tmp/01guest.pdf-pngs/2.png,./tmp/01guest.pdf-pngs/3.png,./tmp/01guest.pdf-pngs/4.png,./tmp/01guest.pdf-pngs/5.png,./tmp/01guest.pdf-pngs/6.png,./tmp/01guest.pdf-pngs/7.png,./tmp/01guest.pdf-pngs/8.png,./tmp/01guest.pdf-pngs/9.png
```## Installation
```bash
go get github.com/motdotla/carve
```## Running Tests
```bash
go test -v
```