1

This question already has an answer here:

Here is the MWE let say our given number is 400, then it should print upto page number of 400 pages in a single pdf file. Here the starting page number is 0001 is shown below.enter image description here

\PassOptionsToPackage{svgnames,x11names}{xcolor}
\documentclass[16pt,a4paper]{scrartcl}              %class
\usepackage[landscape,left=2cm,right=2cm,top=2.5cm,bottom=1cm]{geometry} %for layout
%\usepackage[landscape,left=2cm,right=2cm,top=0.5cm,bottom=2.5cm]{geometry} %for layout
\usepackage[english]{babel}
\usepackage{setspace} % for spacing between lines
\usepackage{graphicx}         %for including images
\usepackage{eso-pic}     %package for including background image
\usepackage{color,tikz,xcolor}
\usepackage{wallpaper,fancyhdr}
\usepackage{ulem,anyfontsize,pdflscape,calligra,niceframe}
\usepackage[T1]{fontenc}
\usepackage[object=vectorian]{pgfornament}
\usepackage{ragged2e,filecontents,tcolorbox}

\definecolor{mycolor}{rgb}{0, 0, 0}% Rule colour
\makeatletter
  \newcommand{\mybox}[1]{%
   \setbox0=\hbox{#1}%
   \setlength{\@tempdima}{\dimexpr\wd0+13pt}%
  \begin{tcolorbox}[colframe=mycolor,colback=mycolor,boxrule=0.5pt,arc=4pt,
      left=6pt,right=6pt,top=6pt,bottom=6pt,boxsep=0pt,width=\@tempdima]
      #1
    \end{tcolorbox}
    }
    \makeatother
    \usepackage{ifthen}
    \newboolean{long}

    \usepackage{fancyhdr}


    \renewcommand{\headrulewidth}{0pt}
    \fancypagestyle{plain}{%
    \fancyhf{}
    \fancyhead[R]{%
    \color{DarkRed}  \ifnum\value{page}<10\relax%
       000\arabic{page}%
       \else
       \ifnum\value{page}<100\relax%
       00\arabic{page}%
       \else
       0\arabic{page}
       \fi
       \fi
    }
    }
    %%==================================
    \usetikzlibrary{shapes.geometric,calc}  
    \definecolor{a}{rgb}{0,0.08,0.45}

    \definecolor{red}{rgb}{0.5,0,0}
    %---------------------------------------------------------------
    \newcommand\BackgroundPic{
    \put(0,0){
     \parbox[b][\paperheight]{\paperwidth}{%
    \vfill
    \centering
     \includegraphics[width=\paperwidth,height=\paperheight,
     keepaspectratio]{tiling.png}              % here include background image

     \vfill
     }}}
       %----------------------------------------------------------------
     %=============================
     \usepackage{datatool}  % This package is required to include database file as .csv 
                   % data.csv includes information from database
       %=============================

       \begin{filecontents}{scripture.csv}
        Condition, BibleVerse, BookName, Chapter, VerseNo
        false,Go therefore and make disciples in all the nation,Matthew,28,19
        \end{filecontents}
        \DTLloaddb{scripture}{scripture.csv} 
          %=============================
          %=============================

              %=============================
           \def\signature#1#2{\parbox[b]{1in}{\smash{#1}\vskip12pt}
            \hfill \parbox[t]{2.8in}{\shortstack{\vrule width 2.8in height 0.4pt\\\small#2}}}
             \def\sigskip{\vskip0.4in plus 0.1in}
             \def\beginskip{\vskip0.5875in plus 0.1in}
            %=============================


           %% Font styles start

            %\setcounter{page}{3000} %% set page numbering

            \input Elzevier.fd
            \newcommand*\initfamily{\usefont{U}{Elzevier}{xl}{n}}

             %% Font styles end


                \def\verrulefill#1{\leaders\hrule width 40pt height#1\hfill}

               \begin{document}


                \pagestyle{plain}

                 \vspace*{-28mm}


                    %% ====== Book Number coding starts here =======================
                  \vspace{-3.1mm}
                 {\flushleft \color{Black}\calligra Book No. \Large 01}\\
                  \hspace*{-1mm} {~}\\
                   %% ====== Book Number coding ends here ======================= 
                  \noindent
                   \hfill
                   %============================= 
                   \vspace*{-20mm}
                    \begin{minipage}[c]{8.3in}
                    {\centering
                    {\onehalfspacing
                     %\fontfamily{pzd}\selectfont

                      %\normalfont\initfamily
                      %  \hspace*{20mm} {\fontsize{30}{30}\bfseries\color{a} \underline{\it{CERTIFICATE OF BAPTISM}}}\\ 
                    \hspace*{50mm} {\fontsize{30}{30}\bfseries\color{black} \MakeUppercase{abc church}}\\
                    \vspace{2mm} 
                     \hspace*{50mm} {\fontsize{25}{25}\bfseries\color{black} {Love \& Service, Since 1920}}\\ 
                    \hspace*{48mm} {\fontsize{25}{25}\color{black} {Abc Road, P.O. Box-00, Ward No.00}}\\ 
                    \hspace*{48mm} {\fontsize{25}{25}\color{black} {ddd-123456, xyz, dyz.}}\\ 
                      \vspace{16mm}

                    }}
                  \end{minipage}

                  \vspace{25mm}
                \hspace*{80mm}\begin{minipage}[c]{6in}
                \mybox{\LARGE \bfseries \color{white} Baptism Certificate}
                 \end{minipage} 



                 \hfill

                 \noindent
                 \begin{minipage}[l]{1.5in}
                 \end{minipage}
                 \hfill

                %=============================
                \begin{minipage}[r]{1.0in}
                \end{minipage}
                 \hfill

                %=============================

                \vspace{0.5cm}
                \doublespacing

               %%============== Uncomment to get output as Black writing===========================
               {\fontsize{18}{18}{\it This is to certify that Mr./Mrs./Miss {{\rule[-0.5ex]{15.7cm}{1.0pt}}}\\ Son/Daughter/Wife of {\rule[-0.5ex]{17cm}{1pt}} inhabitant\\ of {\rule[-0.5ex]{10cm}{1.0pt}} in the ~District of {\rule[-0.5ex]{9.0cm}{1.0pt}}~ was baptised at Diphu Baptist Church and received into full membership on {\rule[-0.5ex]{7.0cm}{1.0pt}}.

                 }}
                 \vspace{6mm}
                 \noindent
                %\beginskip
                {\singlespacing 
                 \vfill
                \begin{minipage}[l]{2.8in}
                 \sigskip \signature{}{\bfseries\color{mycolor} Minister }
                \end{minipage}
                 \hfill
                 \hfill
                 \begin{minipage}[r]{2.8in}
                   \sigskip \signature{}{\bfseries\color{mycolor} Pastor \\ \small ABC Church }
                 \end{minipage}}

                 %=============================
               \vspace{2mm}
                 %\hrulefill\\
               \centering
               \noindent\rule[-1.0ex]{26cm}{1.0pt}\\
                 \hfill
      \DTLforeach{scripture}{\printverse=Condition, \bibleverse=BibleVerse,\bookname=BookName,\chapter=Chapter,\versen=VerseNo}{\setboolean{long}{\printverse}   
      \ifthenelse{\boolean{long}}{\justifying\fontsize{12}{12}\bfseries\it``\bibleverse''.~\textup{\bookname ~\chapter:\versen}}{} 
       \hfill
        \normalfont
       \pagebreak
        }
        \end{document}

marked as duplicate by TeXnician, Schweinebacke, Moriambar, Werner, CarLaTeX May 9 '17 at 7:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Probably your PDF reader has a print dialog. Just issue 400. If you want 400 same pages in LaTeX, have a look at loops (see for instance here). – TeXnician May 9 '17 at 4:25
  • How to use for loop command so that i can print total of 400 pages including page numbering also @TeXnician – Biki Teron May 9 '17 at 5:27
  • 1
    I have given you a link. There is a full explanation of the syntax. Please do some research before asking a well-known and solved problem. – TeXnician May 9 '17 at 5:33
  • I got the results thank you so much @TeXnician – Biki Teron May 9 '17 at 6:06
1

Although you really should be familiar with our format as you already have asked some questions, here's a short version: I just followed the link I provided you with and surrounded your code with that.

\PassOptionsToPackage{svgnames,x11names}{xcolor}
\documentclass[14pt,a4paper]{scrartcl}              %class
\usepackage[landscape,left=2cm,right=2cm,top=2cm,bottom=1cm]{geometry} %for layout
%\usepackage[landscape,left=2cm,right=2cm,top=0.5cm,bottom=2.5cm]{geometry} %for layout
\usepackage[english]{babel}
\usepackage{setspace} % for spacing between lines
\usepackage{graphicx}         %for including images
\usepackage{eso-pic}     %package for including background image
\usepackage{color,tikz,xcolor}
\usepackage{wallpaper,fancyhdr}
\usepackage{ulem,anyfontsize,pdflscape,calligra,niceframe}
\usepackage[T1]{fontenc}
\usepackage[object=vectorian]{pgfornament}
\usepackage{ragged2e,filecontents,tcolorbox}

\definecolor{mycolor}{rgb}{0, 0, 0}% Rule colour
\makeatletter
  \newcommand{\mybox}[1]{%
   \setbox0=\hbox{#1}%
   \setlength{\@tempdima}{\dimexpr\wd0+13pt}%
  \begin{tcolorbox}[colframe=mycolor,colback=mycolor,boxrule=0.5pt,arc=4pt,
      left=6pt,right=6pt,top=6pt,bottom=6pt,boxsep=0pt,width=\@tempdima]
      #1
    \end{tcolorbox}
    }
    \makeatother
    \usepackage{ifthen}
    \newboolean{long}

    \usepackage{fancyhdr}


    \renewcommand{\headrulewidth}{0pt}
    \fancypagestyle{plain}{%
    \fancyhf{}
    \fancyhead[R]{%
    \color{DarkRed}  \ifnum\value{page}<10\relax%
       000\arabic{page}%
       \else
       \ifnum\value{page}<100\relax%
       00\arabic{page}%
       \else
       0\arabic{page}
       \fi
       \fi
    }
    }
    %%==================================
    \usetikzlibrary{shapes.geometric,calc}  
    \definecolor{a}{rgb}{0,0.08,0.45}

    \definecolor{red}{rgb}{0.5,0,0}
    %---------------------------------------------------------------
    \newcommand\BackgroundPic{
    \put(0,0){
     \parbox[b][\paperheight]{\paperwidth}{%
    \vfill
    \centering
     \includegraphics[width=\paperwidth,height=\paperheight,
     keepaspectratio]{tiling.png}              % here include background image

     \vfill
     }}}
       %----------------------------------------------------------------
     %=============================
     \usepackage{datatool}  % This package is required to include database file as .csv 
                   % data.csv includes information from database
       %=============================

       \begin{filecontents}{scripture.csv}
        Condition, BibleVerse, BookName, Chapter, VerseNo
        false,Go therefore and make disciples in all the nation,Matthew,28,19
        \end{filecontents}
        \DTLloaddb{scripture}{scripture.csv} 
          %=============================
          %=============================

              %=============================
           \def\signature#1#2{\parbox[b]{1in}{\smash{#1}\vskip12pt}
            \hfill \parbox[t]{2.8in}{\shortstack{\vrule width 2.8in height 0.4pt\\\small#2}}}
             \def\sigskip{\vskip0.4in plus 0.1in}
             \def\beginskip{\vskip0.5875in plus 0.1in}
            %=============================


           %% Font styles start

            %\setcounter{page}{3000} %% set page numbering

            \input Elzevier.fd
            \newcommand*\initfamily{\usefont{U}{Elzevier}{xl}{n}}

             %% Font styles end


                \def\verrulefill#1{\leaders\hrule width 40pt height#1\hfill}

\pagestyle{plain}
\usepackage{pgffor}

\begin{document}
\foreach \index in {1, ..., 400} {
                 \vspace*{-28mm}


                    %% ====== Book Number coding starts here =======================
                  \vspace{-3.1mm}
                 {\flushleft \color{Black}\calligra Book No. \Large 01}\\
                  \hspace*{-1mm} {~}\\
                   %% ====== Book Number coding ends here ======================= 
                  \noindent
                   \hfill
                   %============================= 
                   \vspace*{-20mm}
                    \begin{minipage}[c]{8.3in}
                    {\centering
                    {\onehalfspacing
                     %\fontfamily{pzd}\selectfont

                      %\normalfont\initfamily
                      %  \hspace*{20mm} {\fontsize{30}{30}\bfseries\color{a} \underline{\it{CERTIFICATE OF BAPTISM}}}\\ 
                    \hspace*{50mm} {\fontsize{30}{30}\bfseries\color{black} \MakeUppercase{abc church}}\\
                    \vspace{2mm} 
                     \hspace*{50mm} {\fontsize{25}{25}\bfseries\color{black} {Love \& Service, Since 1920}}\\ 
                    \hspace*{48mm} {\fontsize{25}{25}\color{black} {Abc Road, P.O. Box-00, Ward No.00}}\\ 
                    \hspace*{48mm} {\fontsize{25}{25}\color{black} {ddd-123456, xyz, dyz.}}\\ 
                      \vspace{16mm}

                    }}
                  \end{minipage}

                  \vspace{25mm}
                \hspace*{80mm}\begin{minipage}[c]{6in}
                \mybox{\LARGE \bfseries \color{white} Baptism Certificate}
                 \end{minipage} 



                 \hfill

                 \noindent
                 \begin{minipage}[l]{1.5in}
                 \end{minipage}
                 \hfill

                %=============================
                \begin{minipage}[r]{1.0in}
                \end{minipage}
                 \hfill

                %=============================

                \vspace{0.5cm}
                \doublespacing

               %%============== Uncomment to get output as Black writing===========================
               {\fontsize{18}{18}{\it This is to certify that Mr./Mrs./Miss {{\rule[-0.5ex]{15.7cm}{1.0pt}}}\\ Son/Daughter/Wife of {\rule[-0.5ex]{17cm}{1pt}} inhabitant\\ of {\rule[-0.5ex]{10cm}{1.0pt}} in the ~District of {\rule[-0.5ex]{9.0cm}{1.0pt}}~ was baptised at Diphu Baptist Church and received into full membership on {\rule[-0.5ex]{7.0cm}{1.0pt}}.

                 }}
                 \vspace{6mm}
                 \noindent
                %\beginskip
                {\singlespacing 
                 \vfill
                \begin{minipage}[l]{2.8in}
                 \sigskip \signature{}{\bfseries\color{mycolor} Minister }
                \end{minipage}
                 \hfill
                 \hfill
                 \begin{minipage}[r]{2.8in}
                   \sigskip \signature{}{\bfseries\color{mycolor} Pastor \\ \small ABC Church }
                 \end{minipage}}

                 %=============================
               \vspace{2mm}
                 %\hrulefill\\
               \centering
               \noindent\rule[-1.0ex]{26cm}{1.0pt}\\
                 \hfill
      \DTLforeach{scripture}{\printverse=Condition, \bibleverse=BibleVerse,\bookname=BookName,\chapter=Chapter,\versen=VerseNo}{\setboolean{long}{\printverse}   
      \ifthenelse{\boolean{long}}{\justifying\fontsize{12}{12}\bfseries\it``\bibleverse''.~\textup{\bookname ~\chapter:\versen}}{} 
       \hfill
        \normalfont
        \pagebreak
        }
}
\end{document}

Not the answer you're looking for? Browse other questions tagged or ask your own question.