Some document types (such as PDF) can require passwords to allow the file to be opened. After you have obtained a fz_document, you should therefore check whether it needs a password using fz_needs_password:
If a password is required, you can supply one using fz_authenticate_password: