Pdf compilation control

Added a control to verify that the pdf is correctly generated, and to
issue a warning message otherwise.