# xelatex multilingual book with framed pages [closed]

I am compiling a multilingual book (Arabic+English), ~1400 pages, using the memoir class, and have been trying to frame each page with a simple black border using the following:

    \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}


The border seems Ok, but I get random empty pages with missing content. I have no idea what is causing this behaviour - I've tried scrpage2 as well, but to the same effect.

Any help will be much appreciated - many thanks for reading.

p.s. I am using TeXLive 2010.

-

## closed as too localized by lockstep, Joseph Wright♦Oct 6 '12 at 22:06

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

The best way to figure out 'what is causing this behaviour' is to construct and post a complete minimal example that demonstrates the problem. That way, either you will figure it out yourself, or someone else will try to come up with a solution. –  jon Sep 12 '12 at 4:49