Bug 110353 - kpdf can't open some pdf files
Summary: kpdf can't open some pdf files
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-07 17:52 UTC by Antonio E.
Modified: 2005-08-08 01:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
This is one of the pdf files. (49.74 KB, application/octet-stream)
2005-08-07 17:58 UTC, Antonio E.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio E. 2005-08-07 17:52:08 UTC
Version:           0.4.2 (kde 3.4.2) (using KDE KDE 3.4.2)
Installed from:    Gentoo Packages
Compiler:          gcc 3.3.5
OS:                Linux

I've got a couple of pdf files that kpdf can't open. Xpdf and kghostview, and also the previous version of kpdf can open them perfectly. The have tables inside rotated 90 degrees. I want to attach the file.
Comment 1 Antonio E. 2005-08-07 17:58:09 UTC
Created attachment 12126 [details]
This is one of the pdf files.

This is one of the pdf files that kpdf can't open.
Comment 2 Albert Astals Cid 2005-08-08 01:54:27 UTC
SVN commit 443936 by aacid:

Fix %%EOF checking
BUGS: 110353


 M  +9 -1      PDFDoc.cc  


--- branches/KDE/3.4/kdegraphics/kpdf/xpdf/xpdf/PDFDoc.cc #443935:443936
@@ -127,7 +127,15 @@
     eof[i] = ch;
   }
   eof[i] = '\0';
-  if (strstr(eof, "%%EOF") == NULL)
+  
+  bool found = false;
+  for (i = i - 5; i >= 0; i--) {
+    if (strncmp (&eof[i], "%%EOF", 5) == 0) {
+      found = true;
+      break;
+    }
+  }
+  if (!found)
   {
     error(-1, "Document does not have ending %%EOF");	      
     errCode = errDamaged;