Forum Bugs

PDF.xmp not working in 16.2 but working in latest(20260805)?

lapinchatware
Hi everyone,

I'm new to Prince and was exploring how to dynamically add XMP metadata to my PDFs. I started with Prince 16.2 on macOS and tried every approach I could find — command-line flags (--pdf-xmp), CSS (-prince-pdf-xmp), and JavaScript (PDF.xmp) — but no matter what combination I tried, the custom metadata never showed up in the output PDF.

As a last test (the last test always works, right?), I installed the latest build and everything just worked!

Could someone confirm whether this was a known bug in 16.2 that's been fixed in the latest build? That would be really helpful for anyone working/testing this feature.

I also have some feedback on the documentation, if I may. As a new user, I rely heavily on it and it's generally been great. But the XMP metadata section could use some improvements. For exemple:
  • It's unclear that setting a <title> (or any other metadata compatible tag) in your HTML will take precedence over and prevent replacement via an external XMP file.
  • The docs are inconsistent about PDF.xmp — version 11 correctly describes it as a property, but later versions refer to it as PDF.xmp(), a function call. In practice, PDF.xmp is a property, not a function.
More generally, I'd love to see more detailed documentation on how Prince handles XMP metadata and metadata in general, particularly around merging added XMP data with HTML-derived metadata.

Thanks for a great tool.
mikeday
Would you be able to attach or email me (mikeday@yeslogic.com) an example of the XMP metadata you are applying?
lapinchatware
Yes, sure. This is a minimal example. I really wish to have a better understanding of what is going on here.

Files have been generated with:
prince forum_minimal_test.html -o forum_minimal.pdf --javascript


When generating with Prince 16.2, no errors are outputted, but no metadata is injected with an XMP XML string. But when generating with Prince 20260805, one error is outputted, but metadata can be injected with an XMP XML string:
prince: warning: replaced default language value in XMP property dc:title
  1. forum_minimal_test.html3.4 kB
  2. forum_minimal_v16_2.pdf52.6 kB
    Generated with Version 16,2.
  3. forum_minimal_v20260805.pdf53.4 kB
    Generated with Version 20260805.
wangp
Could someone confirm whether this was a known bug in 16.2 that's been fixed in the latest build?

Yes, Prince 16.2 and prior were too aggressive in dropping user-provided XMP properties that could conflict with values from elsewhere. This was fixed around July 2025 but appears to not have been recorded on the roadmap.
lapinchatware
Thank you for confirming this. I'm glad to know the issue wasn't on my end!

Reading other posts about XMP on this forum, I realize that Prince strictly follows XMP specifications. I wasn't familiar with those specs, which probably didn't help me either. Time for me to learn: https://developer.adobe.com/xmp/docs/.