I am interested in displaying some things (e.g.: title page) in full color on screen, while having the same object/page display in a black and white friendly form when printed.
According to this SO question, there is built-in functionality in the PDF specification for Screen-Only objects and Screen-And-Print objects. There may also be a way to add a layer on top of the B&W page that only displays the full color page on screen via the PDF 1.5 Optional Content Groups feature.
Similarly, this question demonstrates the selective printing of text via ocg-p
. But it is not clear how I can use this package in the way that I need to.
My scenario is compounded by the fact that my color page text is white on a dark background.
MWE:
This code presents the way I am currently switching back and forth between color and b&w. I change the printincolor
bool variable to make the change.
\documentclass[11pt]{article}
\usepackage[demo]{graphicx}
\usepackage{etoolbox}
\providebool{printincolor}
% Will set color title page and section headings
\setbool{printincolor}{false}
% Setup color if needed
\ifbool{printincolor}{%
\usepackage[pagecolor=none]{pagecolor}%
\definecolor{MyBlue}{HTML}{1b3667}%
\usepackage{afterpage}}{}
\begin{document}
% Begin Title Page
{
\thispagestyle{empty}
\ifbool{printincolor}{%
\pagecolor{MyBlue}%
\afterpage{\nopagecolor}}{}
\begin{center}
{\ifbool{printincolor}{\color{white}\sffamily}{\sffamily}% Set text color white or leave [default] black
\ifbool{printincolor}{\includegraphics[width=1.5in]{logo-gold}}{\includegraphics{logo-blue}}% put logo gold or blue
\\ \vskip 1in
\begin{huge}
\textbf{Title}
\vskip 0.1ex\rule{0.5\textwidth}{0.8pt}\vskip 1ex
Subtitle
\\
\end{huge}
\vfill\vfill
\begin{large}
Authors:\\
John Doe and Jane Doe\\
\end{large}
}
\end{center}
}
\end{document}
How can I layer (or otherwise display) two versions of the title page in a way that color displays on screen, but black and white is printed?