# Insert tex code in pdf document as metadata [duplicate]

I am trying to save the LaTeX code needed for generating some document in the document itself as metadata. So far I found the command to set the pdf metadata using the hyperref package but now I am stuck....

This clearly does not work..

% file.tex
\documentclass[a4paper,10pt]{report}

\usepackage{hyperref,listings}

\hypersetup{
pdfauthor=myself,
pdftitle=Title,
pdfsubject={\lstinputlisting{file.tex}}
}

\begin{document}
Hello world
\end{document}

-

## marked as duplicate by diabonas, Werner, Benedikt Bauer, Martin Schröder, barbara beetonSep 25 '13 at 20:57

My guess is that this is not possible but a workaround could be embedding the file as an attachment, using packages as embedfile or attachfile. –  Bordaigorl Sep 25 '13 at 15:05
@Bordaigorl thanks I'll take a look. With some Java code I can do this but then I have to run an application after the compilation with LaTeX... not so fast... –  Red Sep 25 '13 at 15:09