Ghostscript is returning exit code 0 if password is not set to decode encrypted PDF file

We are trying to transform password protected PDF file using Ghostscript without setting password. We are seeing the below error.

**** Error: Couldn't initialise file. Output may be incorrect. No pages will be processed (FirstPage > LastPage).

**** This file requires a password for access.

It is returning exit code "0" and empty output file.

Due to security reasons, we don't want to provide password to decode the encrypted file.

Is it possible to return exit code other than 0 if password is not set to decode encrypted PDF file ?

Upvotes: 0

Views: 33

Answers (1)

After setting -dPDFSTOPONERROR, it is returning non-zero exit code.

Upvotes: 0

Related Questions