使用magick R导入PDF时出错 [英] Error using magick R to import PDF
问题描述
我有数百个要裁切的PDF.对于每个PDF,我都有一组独特的坐标来进行裁剪.我正在尝试使用R的magick软件包(ImageMagick 6.9.9.14版),但是在导入PDF时收到错误消息.
I have hundreds of PDFs that I want to crop. For each PDF, I have a unique set of coordinates around which to crop. I am trying to use the R's magick package (version ImageMagick 6.9.9.14), but I receive an error when importing a PDF.
magick文档中的此示例引发错误:
This example from the magick documentation throws an error:
library(magick)
manual <- image_read('https://cran.r-project.org/web/packages/magick/magick.pdf', density = "72x72")
我收到的错误是"magick_image_readpath中的错误(路径,密度,深度,条带):Magick:PDFDelegateFailed`系统找不到指定的文件. '@ error/pdf.c/ReadPDFImage/809"
The error I receive is "Error in magick_image_readpath(path, density, depth, strip) : Magick: PDFDelegateFailed `The system cannot find the file specified. ' @ error/pdf.c/ReadPDFImage/809"
当我检查配置设置时:
magick_config
我发现ghostscript是真实的.我不确定要读取PDF是否需要其他设置.
I find that ghostscript is true. I am not sure if there are other settings required for reading in a PDF.
还有其他人遇到过与Magick类似的问题吗?我愿意接受能够裁剪PDF的替代软件包.
Has anyone else encountered a similar problem with magick? I am open to alternative packages with the ability to crop PDFs, if there are any.
推荐答案
我在Windows上遇到了同样的问题.这不是R问题.就我而言,我使用了64位的ImageMagick,但安装了32位的GhostScript.安装64位版本的GhostScript后,它可以正常工作.
I had the same problem on Windows. It was no R problem. In my case, I used ImageMagick 64-bit but had GhostScript 32-bit installed. After installing the 64-bit version of GhostScript it worked without any issues.
这篇关于使用magick R导入PDF时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!