[Tex/LaTex] How to add a PDF file in appendix in Lyx

lyxpdfpdfpages

I'm writing a thesys Using LyX, it worked fine up to now.
I need to insert a PDF of 4 pages in Appendix, so I looked for a solution. Here in StackOverflow I found a possible solution, using a pdfpages package and a command to add the file.
Unfortunately this solution doesn't work, lyx reports the following error:
!pdfTeX error: pdflatex (file test.pdf): cannot find image file

I package is correctly declared in preample, file test.pdf is in the same folder of my thesys files. I tried to substitute the file with a 1 page PDF, and change \includepdf{test.pdf} with
\includepdf{test} and \includepdf{./test.pdf}.
The resulting error is always the same 🙁

Is there a solution? Is it really possible importing a PDF in LyX?
Thanks in advance

Best Answer

I would suggest undoing your changes to the preamble and going to

Insert -> File -> External Material

Then under Template change to "PDF pages" then use browse to find your pdf.

I agree with the above statement because I followed it with success, but in order to insert more than one page like you said that you have under the description in the "PDF pages" if you want all of the pages you need to go to the "LaTeX and LYX Options" tab and in the options bar paste "pages=-". You should also remember that whenever you edit the preamble, you need to immediately go to Tools -> Reconfigure then restart the program in order for the changes to apply, otherwise your problems will not go away. After that, while I don't know how you have your line in the Appendix section set-up, but I used the "standard" set-up; I have not experimented further, but I don't see how the other set-ups would make a difference.

I hope this helps, I wish you luck.