• Syn_Attck@lemmy.today
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    10 days ago

    Good question. I believe the browser “Print to PDF” function simply saves the loaded PDF to a PDF file locally, so it wouldn’t work (if I’m correct.)

    I’m not an expert in this field, but you can ask on StackExchange or the author of MAT or exiftool. You can also do it yourself (I’ll explain how) by making a PDF with a jpg file with your metadata, opening it and printing to pdf, and then extract the image Do let us know your findings! I’m on a smartphone so can’t do it.

    If you do try it yourself, a note from the linked SE page is that you won’t be able to extract the original file extension (it’s unknown, so you either have to know what it is, or look at the file headers, or try all extensions), so if you use your own .jpg with your own exif data, rename to .jpg when finished (I believe exif is handled differently based on file type.)

    There are multiple tools to add exif data to an image but the exiftool website has some easy examples for our purpose.

    (do this as the first step before adding to the PDF)

    (command line here, but there are exiftool GUIs)

    exiftool -artist=“Phil Harvey” -copyright=“2011 Phil Harvey” YourFile.jpg

    Adds Phil Harvey and the copyright information to the file. If you’re on a smartphone and have the time and really have to know, then hypothetically there should be web-based tools for every step needed. I’m just not familiar with any and it’s possible the web-based tool would remove the metadata when creating or extracting the PDF.