将PDF转换为图像 [英] Convert PDF to image

查看:107
本文介绍了将PDF转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的shell中使用此命令将PDF转换为图像

I use this command in my shell to convert from PDF to image

convert -density 150x150 <PDF filename> -append -quality 100 <Image filename>

PDF有四页,但我只需要最后两页。如何从PDF中删除前两页并将剩余的页面转换为图像?

The PDF has four pages, but I only need the last two. How can I remove the first two pages from the PDF and convert the ones which remain to an image?

推荐答案

我假设你是将ImageMagick与GhostScript结合使用。您可以像这样指定PDF的页码:

I assume you are using ImageMagick in combination with GhostScript. You can specify the page number of the PDF like this:

convert -density 150x150 <PDF filename>[0] -append -quality 100 <Image filename>

其中 0 是页码减去1(索引从0开始) 。

where 0 is the page number minus 1 (indexing starts at 0).

在您的特殊情况下,它将是

In your special case it would be

convert -density 150x150 <PDF filename>[2] <PDF filename>[3] -append -quality 100 <Image filename>

这篇关于将PDF转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆