pdf: Fix invalid UTF-8 characters error message

Fixes #1395