We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

XmpMetaData and Pdf- or even PdfFileInfo for that matter

Hi guys,

I’m having an awful time reading/writing meta data to PDF documents. If I use PdfFileInfo’s Get/SetMetaInfo methods, this is really just a wrapper for putting data in the header. Speaking of which, why is there no RemoveMetaInfo, as currently to remove data I have to use Header.Remove().

What I really want to do is to set Xmp meta data. However I’m running in to two problems with this as well.

  1. If I use Pdf.Kit.PdfXmpMetadata…
    a) You make me have to create a schema to write properties - why cannot I have an overload that takes the namespace?
    b) There is no method for me to delete meta data set this way
    c) There is no easy way to get the data back out. It seems all I get is a byte array which I then have to open using a MemoryStream and XmlTextReader, then loop through to try to find my data. Why is there no easy way to get data out via the PdfXmpMetaData object itself?
    d) Why is there an inputstream and outputstream and not just a simple Open or Save wrappers like you do with PdfFileInfo? Sure would make it consistent with your other classes if you did.

  2. If I try to use Pdf.XmpMetaData…in some ways this is better, others worse.
    a) There is a nice AddUserProperty method, but no corresponding Remove, Update, or Read, which like using PdfXmpMetadata above means I can’t get the data out via this object at all. Why?
    b) I like that using an AddUserProperty here has - what? - yes! a way to add a property with a namespace in one call. Funny that XmpMetaData data does, but PdfXmpMetaData does not.

  3. Pdf.Pdf
    a) Why is there a good save method but no open method?

In the end I really want an easy way to do the following scenario:

  1. Open a PDF file
  2. Set a User Property Xmp style
  3. Read that same property back out
  4. Delete that user property if I want to overwrite it later

It doesn’t seem like there is any easy way to do this at all. Help please!



Hi Paul,

We’re looking into your requirements and concerns at our end in detail. You’ll be updated with the results the earliest possible.

We’re sorry for the inconvenience.

Thanks Shahzad - we’re under a tight deadline so the prompt response is much appreciated :slight_smile: Please lmk if there is any other info I can provide.

Hi Paul,

We have looked into your requirement in detail and I’m sorry to share that it can’t be fulfilled with the current version; however, we have logged a new feature request as PDFKITNET-18809 in our issue tracking system. This new feature will allow you to add, update, read and delete the meta data properties easily. Our team will look into this requirement in detail and you’ll be updated via this forum thread once it is available in our future versions.

We’re sorry for the inconvenience.

The issues you have found earlier (filed as 18809) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Awesome guys! You’ve done an awful lot to address all the issues I had and are making my life much easier. :slight_smile:

One open question: is there an easier way for me to use the Get such that instead of returning a byte[] which I have to now parse myself I can simply get back an object, perhaps typed?

For instance if I do this:

PdfXmpMetadata file = new PdfXmpMetadata();
file = file.BindPdf(stream); // presume stream is created elsewhere
string key = "ExternalID"
string keyValue = "006T0000005KIDB"
file.Add(key, keyValue)

It would be great to be able to do this:

PdfXmpMetadata file = new PdfXmpMetadata();

file = file.BindPdf(stream); // presume stream is created elsewhere

string key = “ExternalID”;
string keyValue = file.Get(key);

or even

string keyValue = file.GetAs(key);

Hi Paul,

I’m afraid, this is currently not supported; however, I have logged a new feature request as PDFKITNET-19907 in our issue tracking system. Our team will investigate and try to provide support for this feature in near future.

We’re sorry for the inconvenience and looking forward to help you out.