5

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 ?

1

1 Answer 1

7

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

2
  • Very good solution. Is it possible to add this draw to each page of pdf file ?
    – Mark
    May 19, 2018 at 20:22
  • @Mark Yes, with eso-pic, for instance.
    – user121799
    May 20, 2018 at 1:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .