[luatex] Return value of pdfe.getstatus()

luigi scarso luigi.scarso at gmail.com
Thu Mar 30 13:37:25 CEST 2023


On Tue, 14 Mar 2023 at 14:51, Andreas Matthias <andreas.matthias at gmail.com>
wrote:

> 1)
> I have a user password protected PDF and try to unencrypt it with a
> wrong(!) password.
> To my understanding pdfe.getstatus() should return -1 but actually it
> returns -2 in the
> following example. Did I misunderstand the meaning of -1?
>
> \directlua{
>   doc = pdfe.open('foo.pdf')
>   pdfe.unencrypt(doc, 'wrong_password', nil)
>   stat = pdfe.getstatus(doc)
>   print('Status:', stat) -- returns -2
> }
> \bye
>
>
We have these ones:
ppapi.h:  PPCRYPT_NONE = 0,
ppapi.h:  PPCRYPT_DONE = 1,
ppapi.h:  PPCRYPT_FAIL = -1,
ppapi.h:  PPCRYPT_PASS = -2

Do they match with your code ?



>
> 2)
> If a PDF has been unencrypted successfully, pdfe.getstatus() returns 1. I
> guess it's
> a typo in the documentation (§14.2.2) that says it should return 2.
>
>
I have fixed the manual:
1d00d9173  Fixed description of pdfe.getstatus (A. MATTHIAS).


--
luigi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20230330/a6b2b3b9/attachment.html>


More information about the luatex mailing list.