fix toc rendering bug with pdfsam and output files without the '.pdf' extension