Search code examples
imagepdfpngmetadata

Transfer metadata between files


I am converting many .pdf graphics into .png and I want to keep the metadata of the .pdf files, e.g., Author, Creator, Title, and so on, in the .png.

Is there any way to transfer the metadata from a .pdf into a .png? Or more generally from a file into another file?


Solution

  • This is the most practical and powerful possibility exiftool, an application for Linux, MacOS, and Windows.

    You can transfer all metadata tags from one file into another preserving name and for any file format.

    exiftool -tagsfromfile <source-file> <target-file>
    

    For example, here I transfer the metadata from a .pdf to a .png

    exiftool -tagsfromfile mysource.pdf mytarget.png
    

    Filtering tags: You can also choose the tags to be transferred. For example, if I only want to transfer title, author, and creator, I set the option -<tag>

    exiftool -tagsfromfile mysource.pdf -title -author -creator mytarget.png