[Tex/LaTex] Draw rectangle on absolute coordinates

coordinatesdrawtikz-pgf

I want to draw some rectangles on my pages.

For example a rectangle will be drawn

  • Start from top 5cm, left 4 cm
  • End in 3 cm from right, 2.5 cm from bottom

I tried tikzpicture package, but it draw those rectangles inside the textarea. But I need to draw on absolute coordinates. For example 5cm under the top of the page.
Is it possible ? Which packages should I use ?

Best Answer

try this

\documentclass[A4paper]{article}
\usepackage{tikz}
\usepackage{geometry}
\usetikzlibrary{positioning,calc}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\draw ($(current page.north west)+(4cm,-5cm)$) rectangle  ($(current page.south east)+(-2.5cm,3cm)$) ;
\end{tikzpicture}
\end{document}

requires two compilations

Related Question