【发布时间】:2015-03-23 10:08:36
【问题描述】:
如何获取(子)文件夹中 pdf 的总页数?
我喜欢这样的回报:
c:\pdfs\path1 83
c:\pdfs\path2 12
c:\pdfs\path2\subfolder 3
etc.
使用下面的代码,我可以获得每个 pdf 文件的总页数。但这不是我需要的。我想得到每个文件夹的总数。
REM PDF-Pages.cmd
@echo off
del output.txt
for /r %1 %%f in (*.pdf) do pdfinfo.exe -meta "%%f" >out.txt & echo "%%f",, | tr.exe -d "\r\n" >>output.txt & find "Pages:" out.txt | tr.exe -d "\r\n\055\056\072[:alpha:][:space:]" >>output.txt & echo , | tr.exe -d "\r\n" >>output.txt & find "File size:" out.txt | tr.exe -d "\055\056\072[:space:][:alpha:]" >>output.txt & echo. >>output.txt
del out.txt
【问题讨论】: