fixed crash when generating PDF for libraries