Navigation Menu

Skip to content

motdotla/carve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

carve

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.

BuildStatus

Usage

package main

import (
  "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

go get github.com/motdotla/carve

Running Tests

go test -v

About

Convert PDFs into an array of PNGs. Takes a url of a PDF and converts its pages into individual PNGs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages