[poppler] Metadata access for glib wrapper

Jason Kivlighn jkivlighn at gmail.com
Tue Jun 12 16:50:07 PDT 2007


Hi,

Thanks for the comments.  I made those changes and here's the updated patch.

Cheers,
Jason

p.s. I'm subscribed to the list, but I never got your response (I found the response in the archives).  Not sure what the deal is.

>/ Hi all,
/
hi Jason, 

>/ Here's a patch against CVS to allow the glib wrapper to access PDF XML
/>/ metadata.  It simply adds a new QObject property and reads the
/>/ metadata
/>/ with Catalog::readMetadata()->toCString().
/>/ 
/>/ Having this functionality would really be handy for me.
/
some comments about your patch below. 

>/ Cheers,
/>/ Jason
/>/ 
/>/  
/>/  typedef struct _PopplerDocumentClass PopplerDocumentClass;
/>/ @@ -691,6 +692,14 @@
/>/         flag |= POPPLER_PERMISSIONS_OK_TO_ADD_NOTES;
/>/        g_value_set_flags (value, flag);
/>/        break;
/>/ +    case PROP_METADATA:
/>/ +      catalog = document->doc->getCatalog ();
/>/ +      if (catalog && catalog->isOk ())
/>/ +       {
/>/ +         GooString *s = catalog->readMetadata ();
/>/ +         g_value_set_string (value, s->getCString());
/
readMetada could return NULL, so you should check it before using
s->getCString(). In addition, readMetadata returns a new allocated
GooString, so it should be freed here, just after using it. 

>/ +       }
/>/ +      break;
/>/      default:
/>/        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
/>/      }/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: poppler-glib-metadata-property.patch
Type: text/x-patch
Size: 1339 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20070612/adac8724/attachment.bin 


More information about the poppler mailing list