# How to make custom page frame using LaTeX?

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

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?

-
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
–  Marco Daniel Aug 30 '11 at 12:45

You can use the background package:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{background}
\usetikzlibrary{calc}
\usepackage{lipsum}% just to generate some text

\SetBgScale{1}
\SetBgColor{black}
\SetBgAngle{0}
\SetBgOpacity{1}
\SetBgVshift{-4}
\SetBgContents{
\begin{tikzpicture}[thick]
\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);
\end{tikzpicture}
}

\pagestyle{empty}

\begin{document}

\lipsum[1-4]\newpage

\end{document}


-

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

\documentclass[12pt,a4paper]{report}
\usepackage{eso-pic}
\usepackage{pstricks}

\definecolor{myGray}{rgb}{0.9,0.9,0.9}
\newdimen\BorderWidth \BorderWidth=\paperwidth
\newdimen\BorderHeight \BorderHeight=\paperheight
\newdimen\BorderSep \BorderSep=30pt

\makeatletter
\newcommand\Border{%
\psset{unit=1pt}
\put(\strip@pt\BorderSep,\strip@pt\BorderHeight){%
%    \psframe[linewidth=3pt]%
%     (0,-\BorderHeight)(\BorderWidth, -\BorderSep)
\psline(0,-0.25\BorderWidth)(0,-\BorderSep)(0.25\BorderWidth,-\BorderSep)
\psline(0.75\BorderWidth,-\BorderSep)(\BorderWidth,-\BorderSep)(\BorderWidth,-.25\BorderWidth)
\@tempdima -\BorderHeight