Skip to content
/ pdf2txt Public

convert pdf to markdown using pdftotext utility

License

Notifications You must be signed in to change notification settings

kshard/pdf2txt

Repository files navigation

pdf2txt

The library converts pdf to text formats (e.g. plain text, markdown). The library is built over poppler-utils (version >=22.05.0). pdftotext is required and available in the path.

Quick Start

import (
  "github.com/kshard/pdf2txt"
)

// Create parser
parser, err := pdf2txt.New()
if err != nil {
  panic(err)
}

// Open input stream (io.Reader) to PDF 
fd, err := os.Open(/* path to file */)

// Open output stream (io.Writer) to destination
buf := &bytes.Buffer{}

// Convert
if err := parser.ToText(fd, buf); err != nil {
  panic(err)
}

About

convert pdf to markdown using pdftotext utility

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages