Bug 142140

Summary: kpdf cannot open password protected pdf files
Product: [Unmaintained] kpdf Reporter: Ritesh Raj Sarraf <kde-bugs>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Password protected pdf file which KPDF fails to open

Description Ritesh Raj Sarraf 2007-02-24 11:50:12 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Debian testing/unstable Packages

kpdf is not able to open password protected pdf files.
I've checked the same with xpdf and it can open the password protected pdf files.

The PDF files are my bank statements from Citibank (India).
kpdf never prompts for a password. It just errors out complaining that it couldn't open that particular pdf file.

If I try "Open with XPDF", xpdf prompts me for the password and then opens the file. So this definitely is a kpdf bug.

I had filed a bug in the Debian database (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=369994) but had completely forgotten to file it here. Hope this'll get resolved in 3.5.7.


Thanks,
Ritesh
Comment 1 Pino Toscano 2007-02-24 11:53:38 UTC
Do you have any errors on the console if you start KPDF from there?
What happens if you try opening the document with 'gv'?
Comment 2 Ritesh Raj Sarraf 2007-02-24 13:30:04 UTC
Opening with kpdf from the console still doesn't give any messages on the console.

When I tried with gv, I got the following errors on the console:
rrs@geeKISSexy:/tmp/kde-rrs $ gv VISA\ PREFERRED\ INTERNATIONAL\ -\ GOLD.pdf
   **** Warning: File has a corrupted %%EOF marker, or garbage after %%EOF.
   **** This file requires a password for access.
   **** The file was produced by:
   **** >>>> WB<�a��q�rW�i�PZ�<<<<
ERROR: /invalidfileaccess in pdf_process_Encrypt
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   1   3   %oparray_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1124/1686(ro)(G)--   --dict:0/20(G)--   --dict:108/200(L)--   --dict:104/127(ro)(G)--   --dict:241/347(ro)(G)--   --dict:16/24(L)--
Current allocation mode is local
Last OS error: 2
Current file position is 2349
ESP Ghostscript 815.03: Unrecoverable error, exit code 1
Comment 3 Albert Astals Cid 2007-02-25 19:22:25 UTC
any change we get one of those pdf that fail with kpdf and work on xpdf?
Comment 4 Ritesh Raj Sarraf 2007-02-26 09:25:28 UTC
Hi Albert,

That's my back account statement. It would be difficult for me to give it. :-(

If you want me to try something and report back, please let me know. I'll be happy to do that to find the bug.
Comment 5 Saurav Sarkar 2007-04-09 11:53:26 UTC
Created attachment 20215 [details]
Password protected pdf file which KPDF fails to open
Comment 6 Albert Astals Cid 2007-04-09 13:21:27 UTC
That file is not a pdf file, PDF files must end with %%EOF and this one ends with %%EO, once corrected the file works correctly
Comment 7 Ritesh Raj Sarraf 2008-05-02 10:25:01 UTC
Taken from Debian Bug Report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=369994


On Friday 02 May 2008 00:53:10 Peder Chr. Nørgaard wrote:
> Hello.
>       I ran into exactly the same problem - seemingly.  My monthly earning
> statements has started to come to me in an encrypted PDF file, and it
> looked to me as if kpdf sometimes refused to acknowledge the password.  I
> found this bugreport, and realized I had the same problem as had the
> submitter - my earning statements are confidential, too.  What I did next
> was to retrieve and compile the source codes for kdegraphics and xpdf for a
> pair of comparative gdb session.  At which time I discovered that the
> password I was prompted for was that of kdewallet - kpdf is activating
> kdewallet before it is asking for the pdf password, and if kdewallet has
> not been activated earlier in the KDE session, it is asking for password. 
> This explains why I sometimes succeeded in opening the files and sometimes
> not.
>
>       First I felt a little stupid, but then I realized that this is actual a
> very easy observation mistake to make.  You expect a prompt for a password,
> you get one, then you don't read the prompt text.
>
>       Could it be that the submitter of this bug report has made the same
> observation mistake?  If that is the case the bug could be closed.
>
> best regards