I want to run Pandoc from the server to generate a pdf.
When I run this command, it works and the PDF file is generated.
E:\AgBMPTool\src\static\model\client\user5\pandoc report.txt --pdf-engine=xelatex -o report.pdf
But when I run the command from the server as below, the cmd.Run() failed with exit status 1 occurs.
cmd := exec.Command(“E:/AgBMPTool/src/static/model/client/pandoc”, “report.txt”, “–pdf-engine=xelatex”, “-o”, “report.pdf”)
cmd.Dir = “E:/client/” + path
err = cmd.Run()
My first thought is that you build cmd.Dir in a wrong way and therefore pandoc is unable to find the files. But there should be more info in the actual output of your command.