Mac Terminal change PDF author

I need to change the author of a PDF file on my Mac. I tried using grep and sed to accomplish this, but failed.

If I open the PDF file in Preview.app and go to Tools> Show Inspector, I see "Author: yonatan".

Can I use Terminal.app to change this line?

thanks

PS I know that I can create a new user account on my Mac or use Adobe Acrobat Professional.

+4
source share
3 answers

You can use Automator. I don't think sed will work, because pdfs are mostly binary, or at least randomly. One of the definite "pdf" actions in Automator is the definition of metadata, one of which is the author. Then call the automator workflow using the terminal or just save the workflow as a drop.

+6
source

See screenshot below for more details:

enter image description here

+3
source

The best way would be to use exiftool , which on Mac could be installed using Homebrew :

 brew install exiftool 

You will then edit your metadata in your PDF file as follows:

 exiftool -Title="Change This Title" -Subject="Fun and PDF" change_my_meta.pdf 

Delete metadata

If you want to delete only metadata, you can use pdf-redact-tools :

 pdf-redact-tools --sanitize untrusted.pdf 
0
source

Source: https://habr.com/ru/post/1336814/


All Articles