the question says it all. Are there PDF documents that contain images with different dpi (Dot Per Inch) ?
Or is it assumed that if I know the dpi of one image, I know it of the whole document?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I upvoted @ypnos’ answer, which is completely correct.
But I’d like to complement it by showing a very recent, new feature of the
pdfimagesutility.pdfimageswas previously known to be able to extract images from PDF files (and that was its only useful purpose). However, now you can also use it to investigate for more details about the images used, without extracting them.With the next command I query for the data of all images on pages 7 and 8 of a certain PDF file, using the new
-listparameter:pdfimages -list -f 7 -l 8 ct-magazin-14-2012.pdf page num type width height color comp bpc enc interp object ID --------------------------------------------------------------------- 7 0 image 581 838 rgb 3 8 jpeg no 39 0 7 1 image 4 4 rgb 3 8 image no 40 0 7 2 image 314 332 rgb 3 8 jpx no 44 0 7 3 image 358 430 rgb 3 8 jpx no 45 0 7 4 image 4 4 rgb 3 8 image no 46 0 7 5 image 4 4 rgb 3 8 image no 47 0 7 6 image 4 6 rgb 3 8 image no 48 0 7 7 image 596 462 rgb 3 8 jpx no 49 0 7 8 image 4 6 rgb 3 8 image no 50 0 7 9 image 4 4 rgb 3 8 image no 51 0 7 10 image 8 10 rgb 3 8 image no 41 0 7 11 image 6 6 rgb 3 8 image no 42 0 7 12 image 113 27 rgb 3 8 jpx no 43 0 8 13 image 582 839 gray 1 8 jpeg no 2080 0 8 14 image 344 364 gray 1 8 jpx no 2079 0Note, however: this version of
pdfimagesis the one from Poppler (the one from XPDF does not (yet?) support this new feature):The
-listoption appeared for the first time in Poppler v0.19.0, released on March 1st, 2012.Now, the above list does not directly tell you the resolution (“dpi”) of the image. That value is dependent on: at which size is this image rendered on the PDF page?
A PDF can easily have the same image used at different spots of a PDF file, using a different rendering size for each occasion. The image needs to be embedded into the PDF only once but can be used/rendered ‘by reference’ multiple times (inefficiently constructed PDFs may still contain the same image multiple times, but that’s a different topic…)
Now let’s clear up the questions which may arise from looking at the respective column headings. What do they mean?
pagenumtypeimage(an opaque image),mask(a monochrome image mask),smask(a soft-mask image) andstencil(a monochrome mask image used for painting a color or a pattern). Note: Transparency in PDF for images is created by using two separate PDF objects: one for the image and one for the mask or smask. The mask/smask belonging to a transparent image always directly follows image in the listing.widthheightcolorgray,rgb,cmyk,lab(L*a*b),icc(ICC based),index(indexed colors),sep(separation) anddevn(DeviceN).compbpcencimage(a raster image — may internally use the generic/Flateor/LZWcompression, but not a special image encoding),jpeg(JPEG compression),jpx(JPEG2000 compression),jbig2(JBIG2 compression) andccitt(Fax compression).interpyesif interpolation was requested when scaling up the image.object IDUpdate (March 2016)
As of Poppler v0.25.0 (released December 11, 2013) and later versions, the command
pdfimages -listnow includes new columns which indicate the automatically calculatedx-ppi(horizontal) andy-ppi(vertical) resolutions for each embedded image as displayed within the PDF page by the PDF renderer.In addition, the size (in Bytes/kBytes) used by each image (when uncompressed) as well as its size compression ratio (as embedded in PDF) are indicated.
To show the result (using Poppler v0.42.0) for the same file as above:
x-ppiy-ppisizeratio