[poppler] glib/poppler-document.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Mon Aug 17 05:15:37 PDT 2009


 glib/poppler-document.cc |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

New commits:
commit cb28bc8a637d300664b3c7569263445275333878
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Mon Aug 17 14:14:03 2009 +0200

    [glib] Add FORMAT_MAJOR/MINOR properties to get the PDF version
    
    See bug #23076.

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 6b46fc0..a4ac329 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -40,6 +40,8 @@ enum {
 	PROP_0,
 	PROP_TITLE,
 	PROP_FORMAT,
+	PROP_FORMAT_MAJOR,
+	PROP_FORMAT_MINOR,
 	PROP_AUTHOR,
 	PROP_SUBJECT,
 	PROP_KEYWORDS,
@@ -649,6 +651,12 @@ poppler_document_get_property (GObject    *object,
 		       "%.2g", document->doc->getPDFMajorVersion () + document->doc->getPDFMinorVersion() / 10.0);
       g_value_take_string (value, str);
       break;
+    case PROP_FORMAT_MAJOR:
+      g_value_set_uint (value, document->doc->getPDFMajorVersion ());
+      break;
+    case PROP_FORMAT_MINOR:
+      g_value_set_uint (value, document->doc->getPDFMinorVersion());
+      break;
     case PROP_AUTHOR:
       document->doc->getDocInfo (&obj);
       if (obj.isDict ())
@@ -776,6 +784,24 @@ poppler_document_class_init (PopplerDocumentClass *klass)
 
   g_object_class_install_property
 	  (G_OBJECT_CLASS (klass),
+	   PROP_FORMAT_MAJOR,
+	   g_param_spec_uint ("format-major",
+			      "PDF Format Major",
+			      "The PDF major version number of the document",
+			      0, G_MAXUINT, 1,
+			      G_PARAM_READABLE));
+
+  g_object_class_install_property
+	  (G_OBJECT_CLASS (klass),
+	   PROP_FORMAT_MINOR,
+	   g_param_spec_uint ("format-minor",
+			      "PDF Format Minor",
+			      "The PDF minor version number of the document",
+			      0, G_MAXUINT, 0,
+			      G_PARAM_READABLE));
+
+  g_object_class_install_property
+	  (G_OBJECT_CLASS (klass),
 	   PROP_AUTHOR,
 	   g_param_spec_string ("author",
 				"Author",


More information about the poppler mailing list