El mié, 30-05-2007 a las 10:52 -0700, Jason Kivlighn escribió:
> 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);
>      }

Thanks, 
-- 
Carlos Garcia Campos
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]
   http://carlosgc.linups.org
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x523E6462

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente

_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to