Socket
Socket
Sign inDemoInstall

github.com/joehewett/pdf

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/joehewett/pdf


Readme

Source

PDF Reader

A super lightweight, simple Go library which enables reading PDF files.

This repository is the maintained fork of:

  • https://github.com/joehewett/pdf, which is a fork of
  • https://github.com/ledongthuc/pdf, which was a fork of
  • https://github.com/rsc/pdf

Install:

go get -u github.com/joehewett/pdf

Read plain text

package main

import (
	"bytes"
	"fmt"

	"github.com/joehewett/pdf"
)

func main() {
	r, err := pdf.Open("test.pdf")
	if err != nil {
		panic(err)
	}

	var buf bytes.Buffer
	b, err := r.GetPlainText()
	if err != nil {
		panic(err)
	}

	buf.ReadFrom(b)

	fmt.Println(buf.String())

	return
}

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc