fix pdf index generation