Pdf model to pdf document

Unsure if this is the correct way to submit.

getPageIndex is broken because of a typo(?), where catalog is accessed via pdfModel instead of pdfDocument