Main Menu

Overwrite original PDF

Started by Pman, August 30, 2024, 09:13:20 AM

Previous topic - Next topic

Pman

Finally after hours of trying I got as close as getting the meta dates changed.
No I want to overwrite the original PDF but no success yet.
Hope you can help.
This is what I got so far:
exiftool -time:all -G1 -a -s -overwrite_original "file.pdf"



StarGeek

What is the exact command you are using and the exact output. Simply copy/paste the results here and use the code button (the one with <>). Actual text is easier to read than an image.

Example of working command (anything that is ICC should always be ignored)
C:\>exiftool -time:all --system:all -G1 -a -s Y:\!temp\Test_D10000690C.pdf
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[XMP-xmp]       CreateDate                      : 2018:08:08 14:55:54+03:00
[XMP-xmp]       ModifyDate                      : 2018:08:08 14:55:54+03:00
[PDF]           CreateDate                      : 2018:08:08 14:55:54+03:00
[PDF]           ModifyDate                      : 2018:08:08 14:55:54+03:00

C:\>exiftool -P -overwrite_original -CreateDate="2024:08:30 12:00:00-08:00" -ModifyDate="2024:08:30 12:00:00-08:00" Y:\!temp\Test_D10000690C.pdf
    1 image files updated

C:\>exiftool -time:all --system:all -G1 -a -s Y:\!temp\Test_D10000690C.pdf
[ICC-header]    ProfileDateTime                 : 1998:02:09 06:49:00
[XMP-xmp]       CreateDate                      : 2024:08:30 12:00:00-08:00
[XMP-xmp]       ModifyDate                      : 2024:08:30 12:00:00-08:00
[PDF]           CreateDate                      : 2024:08:30 12:00:00-08:00
[PDF]           ModifyDate                      : 2024:08:30 12:00:00-08:00
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Pman

Hi StarGeek,

Yeah, sorry for the picture disaster.
Couldn't even get that to work.  :D
I was using this:

exiftool -time:all -G1 -a -s -overwrite_original "file.pdf"

I was just trying every line I could find but it didn't work so far.
But your code works like a charm.

By the way...I had to write the line without the > after C:\

Thank you so much!
This is really nice...

StarGeek

That command doesn't set anything, it only displays the data.

I was copy/pasting directly from the command line, which is why the C:\> was included. That's the command line prompting you to enter a command.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Pman

This is what I get if I keep the >:

C:\Users\jep36>C:\>exiftool -time:all --system:all -G1 -a -s C:\Users\jep36\Downloads\test2.pdf
'C:\' is not recognized as an internal or external command,
operable program or batch file.

Pman

I've also added this code to change the Meta data date:

-MetadataDate="2024:08:28 08:58:34-08:00"

I'm getting the hang of it!  :D

StarGeek

Now it's time to let you know that changes to PDFs made by exiftool are reversible.

My copy/paste on the subject

Exiftool uses the incremental update function of PDFs to update the files (see "Incremental Updates in PDF files", Debenu Foxit). This does not remove any previous data and such changes are reversible. In order to make the changes permanent, the file needs to be re-liniarized by a program such as Adobe Acrobat (see here) or qpdf (run qpdf --linearize --replace-input file.pdf).
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).