is there a way to filter out all pds in a folder that have more than 30 pages like qpdf --pages *.pdf and when a documant have more than 30 pages, then extract only the first and last page and generate a new pdf with the first and last site of bevore created pdfs? thx
问问题
140 次
1 回答
0
根据手册,--show-npages
用于计算页数,应该只输出数字。使用for /f
循环将其捕获到变量中。换一个for
来处理每个 PDF:
@echo off
for %%F in (*.pdf) do (
for /f %%A in ('qpdf --show-npages "%%f"`) do (
if %%A gtr 30 (
qpdf "%%F" --pages 1,r1 -- "%%~dpnF-firstlast.%%~xF"
)
)
)
(完全未经测试,因为我只知道qpdf
手册,我刚刚找到)
于 2019-01-25T11:24:41.433 回答