3

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

这是我的输入

c:\test>pdftoppm -r 600 png W10475.pdf test

这是我在关联的“测试”目录中拥有的文件

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

这是我的命令的输出

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 会写入调用它的同一个文件夹。我错了,还是没有输出被写入?如果是这种情况,我如何让它产生一些输出。

4

2 回答 2

1

随着时间的推移,问题变得过时了,现在对于 2021 年的 Windows 用户来说,答案已经大不相同了,但是混淆通常是由于您正在运行两组 pdfto### 实用程序中的哪一组。

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

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

 pdftopng -r 600 file.pdf test

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

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

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

对于Poppler 21.##用户,您仍然需要使用带有 -png 选项的 pdftoppm 命令。

poppler-21.09.0\Library\bin> pdftoppm -r 600 -png file.pdf test

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

于 2021-09-04T18:12:14.837 回答
-2

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

于 2018-03-12T14:18:26.503 回答