Following up, my question is now to replace the text of the heading with a dummy text. I tried multiple options at Line 16, but the text does not seem to go above the margin. Assuming this is solvable, the problem still remains as how to find the exact location for the header text.
% Shamelessly copied from https://www.overleaf.com/learn/latex/Headers_and_footers
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lipsum}
% https://tex.stackexchange.com/a/572688/38244
%%%%%%%%% How to get the heading location?
\usepackage{eso-pic}
\AddToShipoutPictureFG{% Place something in the page ForeGround...
\AtTextUpperLeft{% ...at the text block upper left corner...
\ifnum\value{page}=3 % ...only on page 3...
\makebox[\textwidth]{% ...in the horizontal centre of the text block...
\raisebox{\dimexpr-.5\height-.5\textheight}{% ...at the vertical centre of the text block
\Huge RaNDoM TeXT
}%
}%
\fi
}%
}
\pagestyle{fancy}
\fancyhf{}
\rhead{Overleaf}
\lhead{Guides and tutorials}
\rfoot{Page \thepage}
\begin{document}
\section{First Section}
Hello, here is some text without a meaning. This
text should show what a printed text will look like at
this place. If you read this text, you will get no information.
Really? Is there no information? Is there a difference between
this ...
\lipsum[1-50]
%%%%%%%%%%% Write something on the header of page 3 to replace the current heading
\end{document}
\lhead{\ifnum\value{page}=3\relax RaNDoM TeXT\else Guides and tutorials\fi}
instead of\lhead{Guides and tutorials}
? (Or analogously for\rhead
?)