summaryrefslogtreecommitdiff
path: root/texmf-dist/doc/latex/docassembly/examples/extract-pages.tex
blob: 7cfc1af7d7c274cdfa43a75ec6f5eb76a6921cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
\documentclass{article}
\usepackage{docassembly}
\usepackage{lipsum}

\hypersetup{pdfpagemode=UseNone}

% Look in the Adobe Acrobat JavaScript manual under the doc.extractPages to see all the possible parameters.
% nStart and nEnd are 0-based page numbers, so nStart:1 and nEnd:2 extracts pages 2 and 3
\begin{docassembly}
\retnAbsPathAs(_path);
_path += "/extracted-pages.pdf";
\extractPages({
  nStart: 1,
  nEnd: 2,
  cPath: _path
});
\executeSave();
\end{docassembly}

\begin{document}

\lipsum[1-30]

\end{document}