Bug 23076

Summary: PDF versions as floating-point numbers
Product: poppler Reporter: Jakub Wilk <jwilk>
Component: generalAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: jwilk
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Jakub Wilk 2009-08-01 06:38:14 UTC
poppler represents PDF version numbers as floating point numbers.
This is totally wrong:
- Rounding issues can easily appear.
- PDF-1.10 would be indistinguishable from PDF-1.1.
Comment 1 Albert Astals Cid 2009-08-01 06:48:43 UTC
More info needed, for example where we use a floating point number.
Comment 2 Jakub Wilk 2009-08-01 06:59:29 UTC
$ cd poppler-0.10.6/
$ grep -ir pdfversion .
./glib/poppler-document.cc:		       "%.2g", document->doc->getPDFVersion ());
./qt/poppler-qt.h:  double getPDFVersion() const;
./qt/poppler-document.cc:double Document::getPDFVersion() const
./qt/poppler-document.cc:  return data->doc.getPDFVersion();
./poppler/PDFDoc.cc:  pdfVersion = 0;
./poppler/PDFDoc.cc:    pdfVersion = atof(p);
./poppler/PDFDoc.cc:  outStr->printf("%%PDF-%.1f\r\n",pdfVersion);
./poppler/PDFDoc.h:  double getPDFVersion() { return pdfVersion; }
./poppler/PDFDoc.h:  double pdfVersion;
./utils/pdfinfo.cc:  printf("PDF version:    %.1f\n", doc->getPDFVersion());
./qt4/tests/test-poppler-qt4.cpp:    qDebug() << "    PDF Version: " << doc->pdfVersion();
./qt4/tests/test-password-qt4.cpp:    qDebug() << "    PDF Version: " << doc->pdfVersion();
./qt4/tests/check_metadata.cpp:    QCOMPARE( doc->pdfVersion(), 1.6 );
./qt4/tests/stress-poppler-qt4.cpp:		doc->pdfVersion();
./qt4/tests/stress-poppler-dir.cpp:		doc->pdfVersion();
./qt4/src/poppler-qt4.h:	double pdfVersion() const;
./qt4/src/poppler-document.cc:    double Document::pdfVersion() const
./qt4/src/poppler-document.cc:	return m_doc->doc->getPDFVersion();
Comment 3 Albert Astals Cid 2009-08-16 15:26:01 UTC
Fixed in the core, frontends are yet do be done
Comment 4 Albert Astals Cid 2009-08-16 16:07:46 UTC
Qt3 and Qt4 frontends done.

Carlos can you do the glib one?
Comment 5 Carlos Garcia Campos 2009-08-17 06:04:18 UTC
Done
Comment 6 Albert Astals Cid 2009-08-17 10:14:17 UTC
Closing then

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.