0

I am trying to run Pandoc on MS Azure environment to create HTML report from markdown file. The Pandoc command is real simple one.

pandoc test.md -o test.html

But I get the following error.

pandoc: getAppUserDataDirectory:sHGetFolderPath: illegal operation (unsupported operation)

It seems to me that MS Azure has Windows 10 sort of environment. I even tried to set up XDG_DATA_HOME or XDG_DATA_DIRS, but it still gives the same error.

Can you someone please help?

5
  • This GitHub issue talks about a similar issue. The explanation for the message is as follows: "Some more info: For this specific case the getAppUserDataDirectory does not mean the the User does not have a directory, it is just mean that the Haskel functions and subsequently the win32 libraries that Haskell uses cannot 'find' that directory. This is happening, because the user that run the R Script (thus calling the pandoc.exe) is not a 'real' user." What that tells me is the user attempting to perform the work doesn't have access to the file.
    – Ramhound
    Aug 10, 2021 at 16:27
  • @Ramhound, I looked into the link. I am just running Windows batch file with a pandoc command. I am not sure why it is not able to "see/find" getAppUserDataDirectory. Aug 10, 2021 at 18:53
  • To be clear, getAppUserDataDirectory is a method within Pandoc, so if it's not working then it's probably an environmental variable issue.
    – Ramhound
    Aug 10, 2021 at 18:57
  • Yes. Agree. But how to setup this directory in some way? Aug 10, 2021 at 18:59
  • Have you set --data-dir=DIR to the directory that contains the files? What is the contents of ~/.local/share/pandoc/defaults? The final command would indeed be test.md -o test.html --data-dir=testdir
    – Ramhound
    Aug 10, 2021 at 19:15

1 Answer 1

0

Thank you for all the comments. I was able to solve this issue with using --data-dir flag in my call. Here is what I used.

pandoc test.md -o test.pdf --data-dir=.

(Note . means current directory).

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.