Convert PDF to JPG using the go-fitz Go wrapper for MuPDF fitz library.
go install github.com/sipkg/pdf2jpg
-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
pdf2jpg -out test%03d.jpg -qual 1 -in test.pdf
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