Question: are the "original" image filenames "stored" (with the image data) in the pdf file? #71

Closed
opened 3 years ago by josch · 0 comments
josch commented 3 years ago
Owner

By jaimet on 2020-04-13T14:14:02.981Z

Hi! Just a question: if I use img2pdf to create a pdf file from, say, "mySpecialFilename.jpg", is the filename "mySpecialFilename.jpg" stored somewhere in the pdf file? I am wondering whether I can use the resulting pdf file to record the filename, but when I try "doing the reverse" using pdfimages, all I get out is 000.jpg. Do you know whether the original filename is discarded during "conversion" to pdf, or is pdfimages discarding this information during "extraction"? Thank you!


By josch on 2020-04-13T15:19:17.291Z


Yes, the original filename is discarded. The pdf format does allow you to record where a file that was included in it came from. This is not surprising because other formats don't do that either. A image you edit with gimp also does not store from which file each of its parts come from -- there could even be no file at all. If you want to somehow retain the filename, then maybe pdf page labels are something useful for you because img2pdf put each image on its own page: http://gitlab.mister-muffin.de/josch/img2pdf/issues/57


By josch on 2020-08-04T07:02:49.037Z


Status changed to closed

*By jaimet on 2020-04-13T14:14:02.981Z* Hi! Just a question: if I use img2pdf to create a pdf file from, say, "mySpecialFilename.jpg", is the filename "mySpecialFilename.jpg" stored somewhere in the pdf file? I am wondering whether I can use the resulting pdf file to record the filename, but when I try "doing the reverse" using [pdfimages](https://cgit.freedesktop.org/poppler/poppler/tree/utils/pdfimages.cc), all I get out is `000.jpg`. Do you know whether the original filename is discarded during "conversion" to pdf, or is pdfimages discarding this information during "extraction"? Thank you! --- *By josch on 2020-04-13T15:19:17.291Z* --- Yes, the original filename is discarded. The pdf format does allow you to record where a file that was included in it came from. This is not surprising because other formats don't do that either. A image you edit with gimp also does not store from which file each of its parts come from -- there could even be no file at all. If you want to somehow retain the filename, then maybe pdf page labels are something useful for you because img2pdf put each image on its own page: http://gitlab.mister-muffin.de/josch/img2pdf/issues/57 --- *By josch on 2020-08-04T07:02:49.037Z* --- Status changed to closed
josch closed this issue 3 years ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: josch/img2pdf#71
Loading…
There is no content yet.