Bug 143322

Summary: Kpdf fails to render pdf file
Product: [Applications] kpdf Reporter: Ismail Donmez <ismail>
Component: generalAssignee: Albert Astals Cid <aacid>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Pdf file that renders incorrectly

Description Ismail Donmez 2007-03-22 05:27:05 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Unlisted Binary Package
OS:                Linux

Attached file is generated by Reportlab, is almost empty in kpdf ( no graphics ) but is rendered correctly by Acrobat Reader.
Comment 1 Ismail Donmez 2007-03-22 05:27:32 UTC
Created attachment 20065 [details]
Pdf file that renders incorrectly
Comment 2 Pino Toscano 2007-03-22 13:21:42 UTC
Which version(s)? 3.5.6, SVN or both?
Comment 3 Ismail Donmez 2007-03-22 13:24:54 UTC
3.5 SVN, didn't have a chance to check with vanilla 3.5.6
Comment 4 Albert Astals Cid 2007-03-22 21:42:29 UTC
SVN commit 645533 by aacid:

Accept Width and Height as reals too
BUGS: 143322


 M  +10 -4     Gfx.cc  


--- branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf/Gfx.cc #645532:645533
@@ -3389,18 +3389,24 @@
     obj1.free();
     dict->lookup("W", &obj1);
   }
-  if (!obj1.isInt())
+  if (obj1.isInt())
+    width = obj1.getInt();
+  else if (obj1.isReal())
+    width = (int)obj1.getReal();
+  else
     goto err2;
-  width = obj1.getInt();
   obj1.free();
   dict->lookup("Height", &obj1);
   if (obj1.isNull()) {
     obj1.free();
     dict->lookup("H", &obj1);
   }
-  if (!obj1.isInt())
+  if (obj1.isInt())
+    height = obj1.getInt();
+  else if (obj1.isReal())
+    height = (int)obj1.getReal();
+  else
     goto err2;
-  height = obj1.getInt();
   obj1.free();
 
   // image or mask?