I'm writing a python script to get the dpi of a pdf page. To get the DPI of scanned PDF I am using pdfimages command.
$ pdfimages -list test.pdf
page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
1 0 image 1096 2074 gray 1 8 image yes 9 0 500 500 536K 24%
and I get the DPI in x-ppi and y-ppi fields. I'm using the above command in the program with subprocess module But when I try this with a machine-generated PDF it gives me the below output.
page num type width height color comp bpc enc interp object ID x-ppi y-ppi size ratio
--------------------------------------------------------------------------------------------
Can someone please help how can I get the DPI of a Machine-generated PDF from the ubuntu command line or python.