如何将 PDF 转换为不含文本的图像
我想知道是否可以将 PDF 转换为没有字体的图像。我的目标是只有图像而没有文字?
如果是的话,我可以用 ImageMagick/GhostScript 来做吗?
这是一个示例
图像最终 http://crocodoc_public.s3.amazonaws.com/8b8aa154-45e3-41f9-a465-628e1b2e955d/images/page-001.png
和原始 PDF http://crocodoc.com/demo/efwpa(第2页)我们可以看到文本覆盖在图像上,我想要做同样的事情。
I would like to know if its possible to convert a PDF to and image without fonts. My goal is to have only the image without text ?
And if yes, can I do it with ImageMagick/GhostScript ?
Here an example
The image final http://crocodoc_public.s3.amazonaws.com/8b8aa154-45e3-41f9-a465-628e1b2e955d/images/page-001.png
and the original PDF http://crocodoc.com/demo/efwpa (page 2) We can see that the text are on overlay over the image, what I want is to do the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
因此,如果我没猜错的话,您想要的是从 PDF 中删除一些文本(而不是字体),并且您希望以编程方式执行此操作。我怀疑您已经知道,只有将文本放置在 PDF 文件中的某种单独图层上,这才有可能。您可以尝试使用 iText 来实现此目的。请注意,这意味着您将不得不花一些时间来学习如何使用该库。
So if I got you right, what you want is to remove some text from your PDF (not fonts), and you want to do it programmatically. I suspect you know already that this will only possible if the text is placed on some kind of separate layer in your PDF files. You can try to utilize iText for that. Beware, this will mean you will have to invest some days of learning how to use that library.
我也在寻找类似的东西。
在使用 imagemagick 时,我尝试了这个命令并得到了一些意想不到的结果。
这会从我尝试过的 pdf 中删除文本图层。
我不能保证这对您有用,并且这是实现目标的正确方法,但您可以尝试。
I too am the lookout for something like that.
While playing with imagemagick I tried this a command and got some unexpected results.
this removes the text layers from the pdfs I tried.
I cannot guarantee that this will work for you and if this the right way to achieve, but you may try.
您可以使用 Adobe Acrobat 来完成此操作。使用修饰工具选择文本并将其删除。我认为你不能用 Ghostscript 做到这一点。您可以考虑手动编辑 PDF(qpdf 有帮助)。
You can do that with Adobe Acrobat. Select the text with the touch up tool and delete it. I don't think you can do that with Ghostscript. You could consider editing the PDF by hand (qpdf helps).