Вы также можете использовать pdftk для этого и из интерфейса командной строки (например, C:\Program Files (x86)\PDFtk\bin\pdftk.exe
), приведенный ниже синтаксис завершит то, что вам нужно.
Я могу подтвердить, что это работает, так как этот метод я использовал для этого типа задач лично дома.
Примеры CLI
"C:\Program Files (x86)\PDFtk\bin\pdftk.exe" C:\Path\origfilename.pdf cat 1-8 output C:\PathOut\newfilename1-8.pdf
"C:\Program Files (x86)\PDFtk\bin\pdftk.exe" C:\Path\origfilename.pdf cat 9-16 output C:\PathOut\newfilename9-16.pdf
"C:\Program Files (x86)\PDFtk\bin\pdftk.exe" C:\Path\origfilename.pdf cat 17-24 output C:\PathOut\newfilename17-24.pdf
Пример цикла пакетного скрипта
Вот способ поместить все это в цикл, установить sourcedir и outputdir, установить номера страниц и т.д. С помощью этого бесплатного инструмента. Настройте переменные в соответствии с вашими потребностями.
@ECHO ON
SET PDFtk="C:\Program Files (x86)\PDFtk\bin\pdftk.exe"
SET sourcedir=C:\sourcepath
SET outputdir=C:\outputpath
FOR %%A IN (1-8, 9-16, 17-24, 25-32, 33-40,
41-48, 48-56, 57-64, 65-72, 73-80,
81-88, 89-96, 97-104, 105-112, 113-120,
121-128, 129-136, 137-144, 145-152, 153-160,
161-168, 169-176, 177-184, 185-192
)
DO %PDFtk% %sourcedir%\origfilename.pdf cat %%A output %outputdir%\newfilename%%A.pdf
GOTO EOF
Дополнительные ресурсы
cat [<page ranges>]
Assembles (catenates) pages from input PDFs to create a new
PDF. Use cat to merge PDF pages or to split PDF pages from
documents. You can also use it to rotate PDF pages. Page
order in the new PDF is specified by the order of the given
page ranges. Page ranges are described like this:
<input PDF handle>[<begin page number>[-<end page num-
ber>[<qualifier>]]][<page rotation>]
Where the handle identifies one of the input PDF files, and
the beginning and ending page numbers are one-based refer-
ences to pages in the PDF file. The qualifier can be even or
odd, and the page rotation can be north, south, east, west,
left, right, or down.
If a PDF handle is given but no pages are specified, then the
entire PDF is used. If no pages are specified for any of the
input PDFs, then the input PDFs' bookmarks are also merged
and included in the output.
If the handle is omitted from the page range, then the pages
are taken from the first input PDF.
The even qualifier causes pdftk to use only the even-numbered
PDF pages, so 1-6even yields pages 2, 4 and 6 in that order.
6-1even yields pages 6, 4 and 2 in that order.
The odd qualifier works similarly to the even.
The page rotation setting can cause pdftk to rotate pages and
documents. Each option sets the page rotation as follows (in
degrees): north: 0, east: 90, south: 180, west: 270, left:
-90, right: +90, down: +180. left, right, and down make rela-
tive adjustments to a page's rotation.
If no arguments are passed to cat, then pdftk combines all
input PDFs in the order they were given to create the output.
NOTES:
* <end page number> may be less than <begin page number>.
* The keyword end may be used to reference the final page of
a document instead of a page number.
* Reference a single page by omitting the ending page number.
* The handle may be used alone to represent the entire PDF
document, e.g., B1-end is the same as B.
* You can reference page numbers in reverse order by prefix-
ing them with the letter r. For example, page r1 is the last
page of the document, r2 is the next-to-last page of the doc-
ument, and rend is the first page of the document. You can
use this prefix in ranges, too, for example r3-r1 is the last
three pages of a PDF.
Page Range Examples without Handles:
1-endeast - rotate entire document 90 degrees
5 11 20 - take single pages from input PDF
5-25oddwest - take odd pages in range, rotate 90 degrees
6-1 - reverse pages in range from input PDF
Page Range Examples Using Handles:
Say A=in1.pdf B=in2.pdf, then:
A1-21 - take range from in1.pdf
Bend-1odd - take all odd pages from in2.pdf in reverse order
A72 - take a single page from in1.pdf
A1-21 Beven A72 - assemble pages from both in1.pdf and
in2.pdf
Awest - rotate entire in1.pdf document 90 degrees
B - use all of in2.pdf
A2-30evenleft - take the even pages from the range, remove 90
degrees from each page's rotation
A A - catenate in1.pdf with in1.pdf
Aevenwest Aoddeast - apply rotations to even pages, odd pages
from in1.pdf
Awest Bwest Bdown - catenate rotated documents
shuffle [<page ranges>]
Collates pages from input PDFs to create a new PDF. Works
like the cat operation except that it takes one page at a
time from each page range to assemble the output PDF. If one
range runs out of pages, it continues with the remaining
ranges. Ranges can use all of the features described above
for cat, like reverse page ranges, multiple ranges from a
single PDF, and page rotation. This feature was designed to
help collate PDF pages after scanning paper documents.