TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to make questionnaire template for automatic processing with queXF. To do this I need to produce pages like this:

Example of page with frame

The queXF requirements for the pages are

  • unique barcode for each page (done by using barcode as page number with help of packages fancyhdr, pst-barcode, pstricks-add)
  • page frame for orientation

I need to draw the frame on each page like on the example page above (note that the frame is related to page, but not to text).

I see two ways for achieving this:

  • to set an image background
  • to draw separate lines (preferred)

Is it possible to do using LaTeX?

share|improve this question
Found a hint in answer to different question for using background image: \documentclass{article} \usepackage{wallpaper} \ULCornerWallPaper{1}{background.pdf} \begin{document} Your text \end{document} But the solution without using additional files is still preferred. – Yuriy Petrovskiy Aug 30 '11 at 12:05
You can draw the frame / lines with pstricks. To get the same position ate every site you can use the package atbegshi or the package fancyhdr which do you use. – Marco Daniel Aug 30 '11 at 12:17
I had tried using fancyhdr for this, but it moves text down, below frame. (Maybe I had done something wrong) – Yuriy Petrovskiy Aug 30 '11 at 12:31
up vote 8 down vote accepted

You can use the background package:

\usepackage{lipsum}% just to generate some text

\draw (0.55\textwidth,10) -- (0.55\textwidth,0.52\textheight) -- (0.4\textwidth,0.52\textheight);
\draw (-0.55\textwidth,10) -- (-0.55\textwidth,0.52\textheight) -- (-0.4\textwidth,0.52\textheight);
\draw (-0.55\textwidth,-10) -- (-0.55\textwidth,-0.52\textheight) -- (-0.4\textwidth,-0.52\textheight);
\draw (0.55\textwidth,-10) -- (0.55\textwidth,-0.52\textheight) -- (0.4\textwidth,-0.52\textheight);





enter image description here

share|improve this answer

In relation to my comment here the adapted example with pstricks:


\newdimen\BorderWidth \BorderWidth=\paperwidth
\newdimen\BorderHeight \BorderHeight=\paperheight
\newdimen\BorderSep \BorderSep=30pt
\advance\BorderWidth by -2\BorderSep

    \advance\BorderHeight by -\BorderSep
%    \psframe[linewidth=3pt]%
%     (0,-\BorderHeight)(\BorderWidth, -\BorderSep)
    \@tempdima -\BorderHeight
    \advance\@tempdima .25\BorderWidth
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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