convert init_pdf to get $pdf as reference parameter