Read the metadata of a password-protected PDF

This example shows how to load a password protected PDF and try to read its metadata. Keep in mind that in some cases metadata in a PDF may also be encrypted, in which case reading it without the password is impossible. For reference, the loaded PDF is protected with the owner password 'owner' and user password 'user'.