ImageMagick 无法在 WSL 上将 PDF 转换为图像

Mau*_*uro 3 imagemagick windows-subsystem-for-linux

我尝试使用 ImageMagick 将 PDF 转换为图像,但出现以下错误:

Convert-im6.q16:尝试执行安全策略“PDF”不允许的操作@ error/constitute.c/IsCoderAuthorized/408。

Convert-im6.q16:没有定义图像“tmp/%03d.png”@ error/convert.c/ConvertImageCommand/3258。

我找到了一堆建议修改policy.xml文件的答案(比如thisthis );我的问题是,我不知道在 WSL 上哪里可以找到该文件:我尝试在 /etc/ 中查找它,在 Windows 中进行查找和搜索,但无济于事。知道如何在 WLS 上解决这个问题吗?

Mar*_*ell 5

你可以这样找到它:

identify -list configure | grep CONFIGURE_PATH
Run Code Online (Sandbox Code Playgroud)

如果失败,请使用搜索。

如果失败,请find在 WSL 环境中使用,如下所示:

find / -name policy.xml 2> /dev/null
Run Code Online (Sandbox Code Playgroud)

如果失败,只需使用 Windows 的搜索来查找名为policy.xml