pdfimage

package module
v0.0.0-...-481ef82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

Build

Requires the C compiler to be installed in your OS. For Windows, you can get it through MinGW.

To build move to any directory under ./cmd and use the go build command.

cd ./cmd/pdf2jpg
go build

Usage

PDF2JPG CLI Utility

Converts a PDF document and saves a JPEG image for every page in the PDF document. Prints the list of saved images.

If the job fails on any of the pages being converted it will panic and fail.

pdf2jpg myfile.pdf ouput_dir
./myfile_000.jpg
./myfile_001.jpg

Use gray flag before parameters to output grayscale images.

pdf2jpg -gray myfile.pdf ouput_dir

Set custom height and width

pdf2jpg -h 100 -w 100 myfile.pdf ouput_dir

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckInputError

func CheckInputError(input string, output string) error

func GetPdfImageData

func GetPdfImageData(input string, opt ConvertRequestOptions) ([]image.Image, error)

func PdfToImage

func PdfToImage(input string, output string, opt ConvertRequestOptions) ([]string, error)

Types

type ConvertRequestOptions

type ConvertRequestOptions struct {
	Size      ImageResizeRequest
	Grayscale bool
}

type ImageResizeRequest

type ImageResizeRequest struct {
	H int
	W int
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL