Added auto-closing

Hi! It's my first pull request, please be gentle with me... :-)
Just `expect { pdf.print }.not_to` is actually fine.