Dear All,
I am trying to use "exiftool -all:all=" command line to delete all XMP metadata information from the PDF file. Although it deletes XMP metadata but also removes date and time information from the PDF file. Could you please let me know how I can preserve date and time information in the PDF and delete XMP metadata, I am using Acrobat to view PDF information.
I am sharing with you two PDF files:
1. article.pdf: Original one
2. article_out.pdf: After running command line "exiftool -all:all= -o article_out.pdf article.pdf"
Thanks for all your support.
Regards,
Umesh Vishwakarma
Hi Umesh,
To delete only XMP, use -xmp:all=
If you also want to preserve XMP date/time tags, use -xmp:all= "-all:all<xmp:time:all"
- Phil
Hi Phil,
Thanks for your quick response!!!
I have tried to use "-xmp:all=" but XMP information is still visible in Acrobat, however when I use command line "exiftool -all:all= -o article_out.pdf article.pdf" then XMP is not visible in Acrobat but it just deletes date information.
Please suggest, actually I need to delete other information as well from the PDF like PDF Producer, Application, etc. therefore I want to use "-all:all" option.
Regards,
Umesh
Quote from: uvishwakarma on May 12, 2015, 07:53:21 AM
I have tried to use "-xmp:all=" but XMP information is still visible in Acrobat, however when I use command line "exiftool -all:all= -o article_out.pdf article.pdf" then XMP is not visible in Acrobat but it just deletes date information.
I think Adobe is showing you the info from the IPTC when it doesn't find the XMP. Try adding
-IPTC:All=Hope this helps,
Hayo
You can use -all:all= "-all:all<pdf:time:all" to delete all then recover the PDF date/time tags.
- Phil
Hi Phil,
I tried -all:all= "-all:all<pdf:time:all" but still date information disappears from the PDF when I see it in Acrobat. Finally I followed below steps in my program and successfully preserved date and time information:
1. Extract XMP from the PDF
2. Get original dates from the XMP using XPath (//xmp:CreateDate and //xmp:ModifyDate)
3. Write new date XMP with date information as:
...
<rdf:Description rdf:about=\"\"
xmlns:pdf=\"http://ns.adobe.com/pdf/1.3/\"
xmlns:xmp=\"http://ns.adobe.com/xap/1.0/\"
xmlns:dc=\"http://purl.org/dc/elements/1.1/\"
xmlns:pdfx=\"http://ns.adobe.com/pdfx/1.3/\"
xmlns:pdfxid=\"http://www.npes.org/pdfx/ns/id/\"
xmlns:xmpMM=\"http://ns.adobe.com/xap/1.0/mm/\">
<xmp:CreateDate>$origCreateDate</xmp:CreateDate>
<xmp:ModifyDate>$origModifyDate</xmp:ModifyDate>
<xmp:CreatorTool>Elsevier</xmp:CreatorTool>
</rdf:Description>
...
4. Run command line -all:all= to delete all metadata information
5. Add new date XMP in the PDF to get original date and time
Please let me know whether above followed process is correct or is there any better way to do the same.
Regards,
Umesh Vishwakarma
OK then. The 5 steps you described can be achieved with this exiftool command:
exiftool -all= -tagsfromfile @ -xmp:createdate -xmp:modifydate -xmp:creatortool=Elsevier FILE
But you should read the notes in the PDF tags documentation (https://exiftool.org/TagNames/PDF.html) to understand the implications of the incremental update technique that ExifTool uses.
- Phil
Thanks Phil!!!
Regards,
Umesh Vishwakarma