To change the metadata in PDF files, use a command line tool called exiftool. This tool can manipulate metadata in many file types, but in this post we will focus on changing the metadata in a pdf file.
To install this tool in ubuntu, run below command
$ sudo apt install libimage-exiftool-perl -y
Then, use the exiftool command to list out all the metadata in a pdf file
$ exiftool mypdf.pdf
Some details like below will be shown
ExifTool Version Number : 11.88File Name : mypdf.pdfDirectory : .File Size : 1 MBFile Modification Date/Time : 2022:12:08 07:46:39+08:00File Access Date/Time : 2022:12:08 07:46:43+08:00File Inode Change Date/Time : 2022:12:08 07:46:39+08:00File Permissions : rw-rw-r--File Type : PDFFile Type Extension : pdfMIME Type : application/pdfPDF Version : 1.3Linearized : NoPage Count : 15XMP Toolkit : Image::ExifTool 11.88Title : mypdf.pdfProducer : Nitro PDF PrimoPDFCreate Date : 2022:09:30 16:57:06-08:00Modify Date : 2022:09:30 16:57:06-08:00Creator : PrimoPDF http://www.primopdf.comAuthor : andre
To see just one tag, we can specify it when running exiftool. Let's say I want to see just the Author
$ exiftool -Author mypdf.pdfAuthor : andre
To change the value of the tag, just provide the new value to the tag in the exiftool command. Let's say I want to change the author from andre to john
$ exiftool -Author=john mypdf.pdf
We can verify that the change has been implemented
$ exiftool -Author mypdf.pdfAuthor : john
Once we are satisfied with the change, delete the original backup file that exiftool created prior to changing the metadata
$ rm mypdf.pdf_original
No comments:
Post a Comment