Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac Terminal change PDF author

I need to change the author of a PDF file on my Mac. I have tried to use grep and sed to accomplish this, but haven't succeeded.

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

Is it possible to use Terminal.app to change this string?

Thanks

P.S. I know I can create a new User Account on my Mac or use Adobe Acrobat Professional.

like image 951
joshu Avatar asked Jan 24 '11 16:01

joshu


2 Answers

  1. open Automator & create a New Workflow
  2. search "spec" & add Get Specified Finder Items
  3. search "meta" & add Set PDF Metadata
  4. drag-drop the desired PDFs onto the Get Specified Finder Items area
  5. in the Set PDF Metadata area, update the metadata
  6. in the upper-right corner, click [Run]

For more detail see the screenshot below:

enter image description here

like image 61
Ryan Schumacher Avatar answered Nov 16 '22 11:11

Ryan Schumacher


A better way would be to make use of exiftool, which on Mac you could install with use of Homebrew:

brew install exiftool

You would then edit your metadata in your PDF in the following manner:

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

Removing metadata

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

pdf-redact-tools --sanitize untrusted.pdf
like image 29
Konrad Avatar answered Nov 16 '22 10:11

Konrad