% Graph paper A4 21 x 29.7 cm
% numbers are for 2cm margins; need to be recalculed for diffferent margins

\documentclass{article}
\usepackage[a4paper, portrait, hmargin=2cm, vmargin=2cm]{geometry}
\usepackage{tikz}
\pagestyle{empty}
 
\begin{document}
\begin{tikzpicture}[remember picture,overlay]
    \foreach \y in {28, 56, ...,728}
        \draw[black,line width=0.5pt] (current page.north west) ++(2cm,-2cm-\y pt) -- ++(\paperwidth-4cm,0);
\end{tikzpicture}
\end{document}