首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pdftoppm无法创建输出。

pdftoppm无法创建输出。
EN

Stack Overflow用户
提问于 2017-10-11 22:01:52
回答 2查看 1.5K关注 0票数 3

我从命令提示符运行pdftoppm,但它无法创建任何输出。

这是我的意见

代码语言:javascript
复制
c:\test>pdftoppm -r 600 png W10475.pdf test

下面是关联的“test”目录中的文件

代码语言:javascript
复制
c:\test>dir
 Volume in drive C is OS
 Volume Serial Number is 32C5-D3A1

 Directory of c:\test

10/11/2017  03:36 PM    <DIR>          .
10/11/2017  03:36 PM    <DIR>          ..
10/06/2017  10:00 PM            42,552 convert.exe
10/06/2017  10:00 PM            42,552 magick.exe
08/08/2017  04:22 PM         1,179,648 pdfinfo.exe
08/08/2017  04:22 PM         1,988,096 pdftoppm.exe
08/08/2017  04:22 PM         1,239,040 pdftotext.exe
06/02/2017  12:24 PM           805,964 tesseract.exe
10/09/2017  02:36 PM         5,076,873 W10475.pdf
10/09/2017  02:37 PM         6,376,241 W10926.pdf
10/09/2017  02:37 PM         7,272,812 W11240.pdf
10/09/2017  02:37 PM        11,403,203 W11285.pdf
10/09/2017  02:37 PM         4,576,258 W11292.pdf
10/09/2017  02:37 PM         5,819,421 W11335.pdf
              12 File(s)     45,822,660 bytes
           2 Dir(s)  53,296,689,152 bytes free

这是我命令的输出

代码语言:javascript
复制
pdftoppm version 4.00
Copyright 1996-2017 Glyph & Cog, LLC
Usage: pdftoppm [options] <PDF-file> <PPM-root>
  -f <int>          : first page to print
  -l <int>          : last page to print
  -r <number>       : resolution, in DPI (default is 150)
  -mono             : generate a monochrome PBM file
  -gray             : generate a grayscale PGM file
  -freetype <string>: enable FreeType font rasterizer: yes, no
  -aa <string>      : enable font anti-aliasing: yes, no
  -aaVector <string>: enable vector anti-aliasing: yes, no
  -opw <string>     : owner password (for encrypted files)
  -upw <string>     : user password (for encrypted files)
  -q                : don't print any messages or errors
  -cfg <string>     : configuration file to use in place of .xpdfrc
  -v                : print copyright and version info
  -h                : print usage information
  -help             : print usage information
  --help            : print usage information
  -?                : print usage information

没有抛出错误消息,也没有写入c:\test文件夹的文件。我以为pdftoppm.exe会写到它调用的同一个文件夹。我是弄错了,还是没有写输出?如果是这样的话,我如何让它生成一些输出。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-09-04 18:12:14

问题会随着时间的推移而过时,现在windows用户的答案在2021年有了很大的不同,然而,混淆的原因往往是您正在运行的两组中的哪一组pdfto### utils

首先,问题是为什么从utils生成PNG的Xpdf命令不像Poppler那样工作。但是,您需要使用专用pdftopng exe。(请注意上面的G&C pdftoppm帮助屏幕清楚/没有将-png显示为有效的输出选项)

pdftopng.exe -v4##-将一个PDF文件转换为一系列PNG图像文件。

代码语言:javascript
复制
 pdftopng -r 600 file.pdf test

将产生输出文件test-000001.png等。

注意,您可以添加可选的-alpha,还有许多其他选项,下面是当前的4.03帮助屏幕。

代码语言:javascript
复制
pdftopng --help

pdftopng version 4.03 [www.xpdfreader.com]
Copyright 1996-2021 Glyph & Cog, LLC
Usage: pdftopng [options] <PDF-file> <PNG-root>
  -f <int>          : first page to print
  -l <int>          : last page to print
  -r <number>       : resolution, in DPI (default is 150)
  -mono             : generate a monochrome PNG file
  -gray             : generate a grayscale PNG file
  -alpha            : include an alpha channel in the PNG file
  -rot <int>        : set page rotation: 0, 90, 180, or 270
  -freetype <string>: enable FreeType font rasterizer: yes, no
  -aa <string>      : enable font anti-aliasing: yes, no
  -aaVector <string>: enable vector anti-aliasing: yes, no
  -opw <string>     : owner password (for encrypted files)
  -upw <string>     : user password (for encrypted files)
  -q                : don't print any messages or errors
  -cfg <string>     : configuration file to use in place of .xpdfrc
  -v                : print copyright and version info
  -h                : print usage information
  -help             : print usage information
  --help            : print usage information
  -?                : print usage information

对于波普尔21.##用户,仍然需要使用pdftoppm命令和-png选项。

代码语言:javascript
复制
poppler-21.09.0\Library\bin> pdftoppm -r 600 -png file.pdf test

这将产生类似的输出文件test-1.png等。

票数 1
EN

Stack Overflow用户

发布于 2018-03-12 14:18:26

命令必须是:pdftoppm -r 600 -png W10475.pdf test

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46698234

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档