pdftopm 无法创建输出

标签 pdf ocr pdftoppm

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

这是我的意见

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 文件夹。我认为 pdftopm.exe 会写入调用它的同一文件夹。我是不是弄错了,或者只是没有写入输出?如果是这样,我如何让它生成一些输出。

最佳答案

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

首先,问题是为什么从 Utils 生成 PNG 的 Xpdf 命令无法按照 Poppler utils 工作。但是,您需要使用专用的 pdftopng exe。 (请注意上面的 G&C pdftoppm 帮助屏幕清楚地显示/未显示 -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 选项的 pdftopm 命令。

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

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

关于pdftopm 无法创建输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46698234/

相关文章:

c# - 使用策略标签在 c# (.net) 中将 docx 保存为 pdf

python - 在没有 pdfkit 的情况下将 Pandas DataFrame 保存为 PDF 文件格式

java - 使用 jax-rs 使用 jquery 下载 pdf

ios4 - 使用 ABBYY OCR SDK 从图像中检索到的坐标不正确

php - 在 php 中使用 pdftopm 将 pdf 转换为图像,而无需在磁盘上写入文件

php - 在 TCPDF 中,如何将当前页码获取为整数?

pdf - 是否可以从可搜索的PDF中访问文字叠加层?

java - 安卓工作室 "Could not find method implementation() for arguments"

linux - PDF转ppm保存渐进式jpg