My last post: filecontents: select rows of group to display
And @Werner wrote brilliant solution for me with command : "print"
His MWE code:
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{product.tex}
%Type =1,2...10
No,Type,Name,Description
1,1,A1,D1
2,1,A1,D2
3,1,A1,D3
30,1,A1,D30
31,2,A2,D31
131,2,A2,D131
132,3,A3,D132
133,3,A3,D133
134,3,A3,D134
249,4,A4,D249
1000,10,A10,D1000
\end{filecontents*}
\usepackage{datatool}
\DTLloaddb[autokeys=false]{products}{product.tex}
\newcommand{\printtype}[1]{%
\par
\section*{Type #1}
\DTLforeach*
[\DTLiseq{\Type}{#1}]% Condition
{products}% Database
{\No=No,\Type=Type,\Name=Name,\Description=Description}{%
\noindent\Name \quad \Description\par
\newpage
}%
}
\begin{document}
Here is some text.
\printtype{1}
Some breaking text here.
\printtype{3}
And then some final text.
\end{document}
Now I want to select some page to PDF print, like \includepdf[pages=5-10]? Is possible with \printtype ?
Ex:
\printtype{1}[pages=1-3]
\printtype{2}[pages=2-4]
\printtype{3}[pages=1]
Thanks