-
After successfully replacing images, the (old) references to XMP metadata object as well as the metadata objects still remain in the PDF file. How can I delete these objects? |
Beta Was this translation helpful? Give feedback.
Answered by
jbarlow83
Jul 1, 2023
Replies: 1 comment 4 replies
-
You can delete the XMP metadata by deleting the Root.Metadata object. This XMP belongs to the PDF not the image, unless the PDF generator made your XMP match the image for your specific file. This is a special case so you have to adjust it yourself. (There could be many images in the PDF with different XMP metadata, which is different from the PDF metadata. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
remove_unreferenced_resources removes objects that are not referenced in the corresponding content stream. (Not your case.)
You need to delete the key from the parent dictionary - deleting the object just deletes that reference.
It may be the object is referenced from elsewhere in the PDF, so it cannot be removed.
If you inspect the JSON serialization of the PDF you may be able to find what object references the one you are trying to delete.