7

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?

Yuriy Petrovskiy
  • 401
  • 6
  • 12

2 Answers2

10

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}

enter image description here

Gonzalo Medina
  • 505,128
2

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
\advance\BorderWidth by -2\BorderSep

\makeatletter
\newcommand\Border{%
  \psset{unit=1pt}
  \put(\strip@pt\BorderSep,\strip@pt\BorderHeight){%
    \advance\BorderHeight by -\BorderSep
%    \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
    \advance\@tempdima .25\BorderWidth
    \psline(0,\@tempdima)(0,-\BorderHeight)(.25\BorderWidth,-\BorderHeight)
    \psline(0.75\BorderWidth,-\BorderHeight)(\BorderWidth,-\BorderHeight)(\BorderWidth,\@tempdima)
}}
\makeatother
\AddToShipoutPicture{\Border}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
Marco Daniel
  • 95,681