Bug 166034 - cannot open attached pdf; evince can
Summary: cannot open attached pdf; evince can
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-08 13:15 UTC by Will Stephenson
Modified: 2008-11-09 15:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
online ticket (71.98 KB, application/pdf)
2008-07-08 13:16 UTC, Will Stephenson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Will Stephenson 2008-07-08 13:15:41 UTC
Version:            (using Devel)
Installed from:    Compiled sources

The attached pdf is generated by the german railway's online booking system.  Okular refuses to open it, saying "Could not open file ...", console output:

okular(25780)/kdecore (trader) KMimeTypeTrader::query: query for mimeType  "application/pdf" ,  "okular/Generator"  : returning  1  offers                                                                                                                
Error: May not be a PDF file (continuing anyway)                                                                             
Error: PDF file is damaged - attempting to reconstruct xref table...                                                         
Error: Couldn't find trailer dictionary                                                                                      
Error: Couldn't read xref table                                                                                              

But 
file OT18103265958.pdf
OT18103265958.pdf: PostScript document text conforming DSC level 3.0, Level 2

and evince (using same libpoppler3-0.8.2-1.1) can open it.
Comment 1 Will Stephenson 2008-07-08 13:16:15 UTC
Created attachment 25931 [details]
online ticket
Comment 2 Albert Astals Cid 2008-07-22 22:23:41 UTC
the file is not a pdf, rename it to .ps and that's all
Comment 3 Pino Toscano 2008-11-09 15:21:22 UTC
SVN commit 881991 by pino:

Shuffle a bit the way documents are opened:
- when there are no backends for handling the document mimetype, try harder using the mimetype from the file content only
- when the backend fails loading, try again with the backend that handles the mimetype of the file content
BUG: 166034


 M  +107 -62   document.cpp  
 M  +1 -0      document_p.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=881991