Skip to content
/ pdf2jpg Public

Convert PDF file to one or multiple JPG files

License

Notifications You must be signed in to change notification settings

sipkg/pdf2jpg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pdf2jpg

Convert PDF to JPG using the go-fitz Go wrapper for MuPDF fitz library.

Install

go install github.com/sipkg/pdf2jpg

Usage

  • -in filename path to pdf file to convert
  • -out file%0d.jpg pattern file for jpg files
  • -qual 10 quality of jpg, 1 to 100, the higher the better, default to 10

Example

pdf2jpg -out test%03d.jpg -qual 1 -in test.pdf

FAQ

How to cross-compile from linux to windows

You must enable CGO as go-fitz uses it. You also need an appropriate compiler and toolchain for the targeted arch. Here, we will use MinGW-w64. See their website for instructions to install it for your distribution.

# install MinGW the Debian/Ubuntu way
sudo apt-get install mingw-w64

# then you can cross-compile
GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" go build

About

Convert PDF file to one or multiple JPG files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages