My goal is to use pdftotext without the need to install $ sudo apt-get install poppler-utils.
The code:
package main
import (
"fmt"
"os/exec"
)
func main() {
body, err := exec.Command("pdftotext", "-layout", "-q", "-nopgbrk", "-enc", "UTF-8", "-eol", "unix", "/Volumes/T7Touch/Learn/e-statement-to-t-account/5725299769Jul2022.pdf", "-").Output()
if err != nil {
panic(err)
}
fmt.Println(string(body))
}
What I've tried:
- I use
pdftotextwhich require installation and only available (without package manager like Homebrew) for linux by doing$ sudo apt-get install poppler-utils.
The problem:
- If I run this go binary in my Mac, it won't work because I have not installed
poppler-utils. I am only able to use this onVisual Studio Code's dev container.