PDF: fix a typo

... where we were referencing the wrong field.

Also add some error handling for a fragile part.