I was very pleased to see that version 9.5.1 of Spire.PDF for Android implemented SPIREPDF-5639 so that adding new custom properties will no longer cause loss of existing custom properties.
However, version 9.7.1 adds the new feature which "Adds a new method pdf.getDocumentInformation() to get the Metadata data, and deprecated XmpMetadata."
This makes our current project no longer usable (again).
Basically, our project uses PDF/A that already contain XMP metadata (written by another application which uses Spire.PDF for Java).
It reads this metadata and also adds new custom properties.
I created a test setup to figure out what is wrong.
This tests the following:
1. Read metadata from a PDF with XMP metadata. Then write a new custom property.
2. Read metadata from a PDF/A with XMP metadata. Then write a new custom property.
3. Read metadata from a PDF with a custom property. Then write a new custom property.
4. Read metadata from a PDF/A with a custom property. Then write a new custom property.
Test output:
- Code: Select all
------------------------------metadataTest_copy.pdf ------------------------------
Read: Metadata1=true; Metadata2:=null
Setting metadata2=Some text
Read: Metadata1=true; Metadata2:=Some text
------------------------------metadataTestAndroid_copy.pdf ------------------------------
Read: Metadata1=true; Metadata2:=null
Setting metadata2=Some text
Read: Metadata1=true; Metadata2:=Some text
------------------------------metadataTestPdfA_copy.pdf ------------------------------
Read: Metadata1=true; Metadata2:=null
Setting metadata2=Some text
Read: Metadata1=true; Metadata2:=null
------------------------------metadataTestAndroidPdfA_copy.pdf ------------------------------
Read: Metadata1=true; Metadata2:=null
Setting metadata2=Some text
Read: Metadata1=true; Metadata2:=Some text
Case number 2 (metadataTestPdfA_copy.pdf) does not work, the new custom property is either not written to the PDF/A or can not be read afterwards.
This is not good for us because we supply these PDF/A with XMP metadata to our customers so that they can use our application to digitally edit them. They have already been distributed, so need to be usable by our app. Thus, if we are no longer able to use PDF/A with already filled out XMP metadata, we can no longer update Spire.PDF for Android and thus we will no longer purchase licenses and potentially migrate to another PDF library for Android.
To reproduce this, you have to do the following:
1. Load the project from the attachment.
2. Copy the two PDFs from the ZIP onto your Android device (or emulator) into the directory "\Android\data\com.example.spiretest\files".
3. Run the application.
4. Look at the console output.
I would really like to have "Spire.PDF for Android via Java" be reliable. Unfortunately, there have been quite a few issues, especially regarding XMP metadata / custom properties.
I am at a point where I would recommend "Spire.PDF for .Net" to anyone, but I would currently advice against using "Spire.PDF for Android". I hope you can do something to change that. Because having one reliable library for .Net, Java and Android is quite a convincing feature of your product suite. But if some of those platforms aren't given enough love...