I am wondering if there are already some tools in TeX available that can handle the following problem. If not, I believe there is a possibility to do this. I want to overlay a transparent-to-white picture onto some pages of my document; as it is done in a lot of journals. Thus, the reader can start reading the, e.g., first paragraph while a full read needs the original document. Some example:
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage{tikz}
\newcommand{\blend}
{
\begin{tikzpicture}[remember picture, overlay]
\node[inner sep=0pt] at (current page.center)
{%
\includegraphics[width=\paperwidth,height=\paperheight]{blend}%
};%
\end{tikzpicture}%
}
\begin{document}
\blindtext[4]
\blend
\blindtext[4]
\blend
\end{document}
The blend.png file is just a picture with a transparent-to-white color gradient. However, as one can see, the overlay does not cover the whole page (the second \blindtext[4] on the first page is visible). Furthermore, it would be nice to construct a new command that stores the page numbers where the overlay should happen. Additionally, rather than inserting a *.png file, I guess it would be better to use tikz directly (smaller files).

However, I am thinking, that creating the PDF without the overlay while modifying it afterward (e.g. using convert) may be a better approach? Any hint is appreaciated.


tex codeis a good starting point. – Tobi Nov 02 '19 at 20:17pdf2txt, as you say. – Nov 02 '19 at 20:37