3

I've created a tool to include PDF documents on a larger page to provide margins and a grid to facilitate commenting and markup. I'm happy with the results except that the grid background behind the PDF document itself is distracting. I'd like the included document background to be non-transparent (preferably white).

Wrapper document

The "wrapper" document:

\documentclass{article}

\usepackage[width=20in,height=15in,landscape,margin=1in]{geometry}  
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{lastpage}    
\usepackage[printwatermark]{xwatermark}
\newwatermark[allpages,angle=0,scale=0.5,xpos=-100,ypos=-1]{\includegraphics{Grid}}    
\usepackage{pdfpages}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{ifthen}

\begin{document}
\includepdf[frame,pages=-,templatesize={8.5in}{11in},noautoscale=true,scale=0.5,offset=-170 0]{MWE_doc}
\end{document}

The document:

 \documentclass{article}
 \usepackage{blindtext}
 \begin{document}
 \Blindtext[5]
 \end{document}

The grid (background watermark)

 % Graph paper
 % Author: Benjamin Abel
 \documentclass{article}
 \usepackage{geometry}
 \usepackage{tikz}
 %%%<
 \usepackage{verbatim}
 \usepackage[active,tightpage]{preview}
 \PreviewEnvironment{tikzpicture}
 \setlength{\PreviewBorder}{10pt}%
 %%%>

 \begin{comment}
 :Title: Graph paper
 :Tags: Plotting;Transparency;Graphs;Plots
 :Author: Benjamin Abel
 :Slug: graph-paper
 A little document that permits to draw a graph paper for students.
 \end{comment}
 \def\width{68}
 \def\hauteur{44}

 \begin{document}
 \begin{tikzpicture}[x=1cm, y=1cm, semitransparent]
 \draw[step=0.5cm, line width=0.1mm, blue!35!white] (0,0) grid (\width,\hauteur);
 \end{tikzpicture}

 \end{document}

Using \pagecolor{white} in conjunction with the xcolor package doesn't seem to help.

  • Have you seen this thread? tex.stackexchange.com/questions/323751/… – AML May 10 '18 at 18:13
  • @AML I have seen this and my attempts don't seem to work; furthermore, if the source PDF (the one to be included) is non-LaTeX, I'd still like to make the background non-transparent. – Martin Clouthier May 10 '18 at 18:29
  • @JohnKormylo No. I want to use my iPad and pencil to write comments on top of an existing PDF (as I've done in the posted image). I'm using the wrapper to provide more space to write. – Martin Clouthier May 10 '18 at 18:44
  • You can put another background behind the PDF, but the grid will still show. To remove the grid, you need to edit the PDF. – John Kormylo May 10 '18 at 18:54
5

An intermediate step (B) can be added to add a white background:

  • A: Original PDF file (see question)

  • B: White background

  • C: Grid wrapper (see question)

B.tex would be something like:

\documentclass{article}

\usepackage{color}
\pagecolor{white}

\usepackage{pdfpages}

\begin{document}
  \includepdf[pages=-]{A}
\end{document}

C: The wrapper must load pdfpages before package xwatermark. The order matters because both packages meddle with the page shipout.

Result

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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