Finalizing pdf creation