根据评论中的讨论,一个行动方案是通过python解析页面信息(MediaBox)。然而,我更喜欢一些快速的cmd行命令,而不是在这个轻量级的上网本上编写和测试一个更重的解决方案。
因此,我将建立一个脚本来处理一个循环的文件,并将文件传递给windows控制台,使用 Xpdf命令行工具
Edit 实际上,大多数Python库都倾向于包括pdfinfo的poppler版本(2022-01),所以你应该能够通过你的库调用或请求该变体的反馈。
在你的文件上使用PDFinfo并将其限制在前20页进行快速测试是
【替换代码0 响应将是一个适合比较的文本输出:-
Title: Microsoft Word - 20190702_Revision_CO2_Verordnung_Detailkommenta
re_SWISS_final
Subject:
Keywords:
Author: heim
Creator: PDF24 Creator
Producer: GPL Ghostscript 9.25
CreationDate: Thu Jul 18 17:36:26 2019
ModDate: Thu Jul 18 17:36:26 2019
Tagged: no
Form: none
Pages: 223
Encrypted: no
Page 1 size: 595 x 842 pts (A4) (rotated 0 degrees)
Page 2 size: 595 x 842 pts (A4) (rotated 0 degrees)
Page 3 size: 595.32 x 841.92 pts (A4) (rotated 0 degrees)
Page 4 size: 595.44 x 842.04 pts (A4) (rotated 0 degrees)
Page 5 size: 595.44 x 842.04 pts (A4) (rotated 0 degrees)
Page 6 size: 595.2 x 841.9 pts (A4) (rotated 0 degrees)
Page 7 size: 595.45 x 841.9 pts (A4) (rotated 0 degrees)
Page 8 size: 595.45 x 841.9 pts (A4) (rotated 0 degrees)
Page 9 size: 595.2 x 841.44 pts (rotated 0 degrees)
Page 10 size: 595.2 x 841.44 pts (rotated 0 degrees)
Page 11 size: 595.2 x 841.68 pts (rotated 0 degrees)
Page 12 size: 594.54 x 840.78 pts (rotated 0 degrees)
Page 13 size: 591.85 x 835.45 pts (rotated 0 degrees)
Page 14 size: 593.75 x 835.45 pts (rotated 0 degrees)
Page 15 size: 595.2 x 841.44 pts (rotated 0 degrees)
Page 16 size: 595.32 x 841.92 pts (A4) (rotated 0 degrees)
Page 17 size: 593.5 x 840.7 pts (rotated 0 degrees)
Page 18 size: 594.72 x 840.96 pts (rotated 0 degrees)
Page 19 size: 596 x 842 pts (A4) (rotated 0 degrees)
Page 20 size: 595.2 x 841.68 pts (rotated 0 degrees)
File size: 33926636 bytes
Optimized: no
PDF version: 1.4