Bug 110034 - KPDF can't open this PDF file
Summary: KPDF can't open this PDF file
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-02 14:12 UTC by Jure Repinc
Modified: 2007-02-27 00:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
PDF that can't be opened (67.73 KB, application/pdf)
2005-08-02 14:13 UTC, Jure Repinc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jure Repinc 2005-08-02 14:12:29 UTC
Version:           SVN KDE 3.5 branch (using KDE Devel)
Installed from:    Compiled sources
Compiler:          GCC 3.4.4 AMD64
OS:                Linux

When I try to open the PDF file, which I will attach, KPDF says:

Could not open file:///home/kdedev/obrazec-pridobivanje-2005.pdf

KGhostViwer from SVN and KPDF from KDE 3.4.1 open it just fine.
Comment 1 Jure Repinc 2005-08-02 14:13:38 UTC
Created attachment 12049 [details]
PDF that can't be opened

This is the file that KPDF can't open.
Comment 2 Albert Astals Cid 2005-08-02 18:41:51 UTC
SVN commit 442420 by aacid:

Increase the range in which we look for %%EOF
BUGS: 110034


 M  +5 -4      PDFDoc.cc  


--- branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf/PDFDoc.cc #442419:442420
@@ -115,9 +115,9 @@
 GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
   str->reset();
   
-  char eof[8];
+  char eof[9];
   int pos = str->getPos();
-  str->setPos(7, -1);
+  str->setPos(8, -1);
   eof[0] = str->getChar();
   eof[1] = str->getChar();
   eof[2] = str->getChar();
@@ -125,10 +125,11 @@
   eof[4] = str->getChar();
   eof[5] = str->getChar();
   eof[6] = str->getChar();
-  eof[7] = '\0';
+  eof[7] = str->getChar();
+  eof[8] = '\0';
   if (strstr(eof, "%%EOF") == NULL)
   {
-    error(-1, "Document does not have ending %%EOF");	      
+    error(-1, "Document does not have ending %%EOF");
     errCode = errDamaged;
     return gFalse;
   }
Comment 3 Gregor B. Rosenauer 2007-02-26 21:54:15 UTC
I have encountered a similar problem with the PDF at:
http://www.softwarefactories.com/ScreenShots/MS-WP-04.pdf

KGhostView opens it fine, as does AcrobatReader 7.0.8.
Document-Info from Acrobat:
PDF Version 1.3
Tagged: No
Creator: QuarkXPress 4.11

Also preview (thumbnail) in konqueror works.
Comment 4 Albert Astals Cid 2007-02-27 00:09:44 UTC
sorry but the file you point to is not a pdf as it does not end in the mandatory %EOF