[Tex/LaTex] How to superimpose LaTeX / TeX output over a PDF file

formspdf

I have a form as a PDF file. I would like to use LaTeX/TeX to overlay my text over the form, and send the output to either a print or another PDF file.

Is this possible? How would I go about it?

Best Answer

One idea is to include pdf page using pdfpages (see pdfpages at CTAN), and then put a tikzpicture on top. Tikzpicture can be absolutely positioned with remember picture, overlay option. The question is similar to Can I add tikzpictures to pages included with pdfpages.

A MWE would look like this:

\documentclass[12pt]{article}

\usepackage{pdfpages}
\usepackage{tikz}
\begin{document}
\includepdf[pagecommand={\begin{tikzpicture}[remember picture, overlay]\node at (current page.center) {overlayed text};\end{tikzpicture}}]{filename}
\end{document}