cmd.Run() failed with exit status 1

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()

Thanks in advance if anyone could help.

You might want to look at stdout/stderr from pandoc to see what it says. At first glance the command to run pandoc looks reasonable to me.

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.