Added pdf preview generation