BASALT · JOURNAL
How to check the resolution of a PDF on a Mac
To check the resolution of a PDF on a Mac, find each image's pixel size and divide by the size it's drawn on the page. A full-page scan that is 2550 pixels across a page 612 points wide has 2550 pixels over 8.5 inches, which is 300 pixels per inch (ppi). Preview doesn't show this number, so you read it from the file or from a command.
A PDF has no single resolution. Text and vector drawings have none at all, because they're described as shapes that stay sharp at any zoom. Only embedded images have one, and each image can have a different value.
Why a PDF has no one DPI
A pixel image inside a PDF is stored with its width and height in pixels, for example 2550 by 3300. The page then draws that image at some size measured in points, where 72 points make an inch. The same image drawn at half the width has twice the pixels per inch. So resolution is a property of an image on a page, not of the file.
That is why the answer to "what is the DPI of this PDF" depends on what you mean. For a scan, there's usually one big image per page, and its effective ppi is what matters. For a report exported from a word processor, the text is sharp at any size, and only the logos and photos have a ppi worth checking.
DPI and ppi get used interchangeably. Strictly, dots per inch describes a printer and pixels per inch describes an image, and a PDF only knows pixels and sizes.
The arithmetic
Take the image's width in pixels, then divide by the width it's drawn at in inches. The drawn width in points divided by 72 gives inches.
For a full-page scan on a US Letter page, 612 points is 8.5 inches. A 2550 pixel wide image gives 2550 divided by 8.5, which is 300 ppi. The same page scanned at 1275 pixels across gives 150 ppi. Do the same with the height as a check: 3300 pixels over 11 inches is also 300.
If the two ratios differ, the image is stretched. The usual range people aim for is around 300 ppi for text that must be read closely or run through OCR, with lower values common for email copies. Treat that as a rule of thumb rather than a standard.
Check it on a Mac with built-in tools
Preview's Inspector (Tools > Show Inspector) gives you the page size, which is the other half of the sum. It doesn't report image pixel counts, so you need Terminal for those. Install qpdf with brew install qpdf, then ask for the images on each page:
qpdf --json --json-key=pages document.pdf
Under each page, the images list gives each image's name, width and height in pixels. A 600 by 600 test image reported "name": "/Im1", "width": 600 and "height": 600. That's the pixel count, not how large the image is drawn.
To find the drawn size, print the page's content stream, the drawing instructions. The same output lists it under contents as an object reference, such as "3 0 R", and you pass the first number:
qpdf --show-object=3 --filtered-stream-data document.pdf
Look for something like 144 0 0 144 72 500 cm /Im1 Do. When the second and third numbers are zero, the first and fourth are the drawn width and height in points. Here the image is drawn 144 points wide, which is 2 inches, so the 600 pixel image is 300 ppi. The name before Do (/Im1) matches the image's name in the JSON. Content streams on real files are longer, and an earlier cm in the same stream can scale everything after it, so for a full-page scan the page size is the easier route.
A page's size is its /MediaBox, four numbers with the last two giving width and height in points. It can be inherited from the parent pages object, so check there if the page itself doesn't list one. 612 by 792 is US Letter.
The direct way with pdfimages
Poppler's pdfimages prints the effective resolution itself. Install it with brew install poppler (see poppler.freedesktop.org), then run:
pdfimages -list document.pdf
Its manual page lists a row per image with its width and height in pixels and two columns, x-ppi and y-ppi, described as the resolution "when rendered on the pdf page." That's the effective pixels per inch, already worked out. A scan at 300 should show 300 in both columns, and two different values mean the image is stretched.
What the result means for the next step
A scan at a low ppi will look soft when printed, and OCR tends to do worse on it. Raising the number afterward doesn't help, because resampling can't add detail that was never captured. You'd have to rescan.
A scan far above 300 ppi is mostly wasted space. If a file is too big to email, lowering the image resolution is the usual fix. Scanned PDF size explained covers where the megabytes go, reducing size without blur covers the safe settings, and blurry PDFs after compression covers what happens when the value is set too low. Before running OCR, it's worth knowing the number first. See making a PDF searchable.
Frequently asked questions
How do I check the DPI of a PDF on a Mac?
Work it out per image: divide the image's width in pixels by its drawn width in inches. Get the pixels from qpdf --json --json-key=pages, and the drawn width from the page content or the page size for a full-page scan. If you've installed Poppler, pdfimages -list shows the pixels per inch directly. Preview doesn't display it.
Does a PDF have a DPI?
Not as a single value. Text and vector art have no resolution, and each embedded image has its own effective pixels per inch, depending on how large the page draws it.
How do I check the resolution of a PDF image?
Read the image's pixel width and height from qpdf's page listing, then compare them with the size the image is drawn at. For an image that fills a 612 point wide page, 2550 pixels means 300 ppi. For a smaller placed image, divide by the drawn width, not the page width.
Is 300 DPI enough for a PDF?
For reading and OCR of ordinary documents, 300 ppi is the usual target. Files meant for email often use less. It isn't a rule written into the PDF format, so treat it as a practical guideline.
How can I see the resolution of a PDF in Preview?
You can't read it directly. Preview's Inspector shows the page size, page count and file size, but no image pixel counts or ppi. Use the page size together with qpdf's image list, or use pdfimages -list for the number itself.
Why does my scanned PDF look blurry when I zoom in?
The image probably has too few pixels for the size it's drawn at. A scan at 100 ppi has only about a third of the linear detail of one at 300. Raising the DPI in a later step won't recover it. Rescan at a higher setting, or check whether an earlier compression lowered it.
Can I change the resolution of a PDF?
You can lower it by downsampling the images, which makes the file smaller. You can't truly raise it, because new pixels are only copies or guesses. Lowering it is done with a compression tool that lets you pick a target resolution.
Doing it in Basalt
Basalt doesn't display a per-image resolution, so use the commands above to read the number. Where it helps is the next step, lowering resolution to shrink a file. Its Compress tool has presets for Email, Balanced and Print that target images at 96, 150 and 300 DPI, and a Custom setting where you choose the DPI, the JPEG quality and whether to convert to grayscale. It measures the size before writing, and a file that would come out larger is never written. Like every tool in Basalt it saves a new file and leaves your original alone. A license is $29 once for up to three Macs, after a free 24 hour trial that has every tool.
Redaction that proves itself
Basalt destroys the content you mark, then re-opens the file it wrote and proves the content is gone before it saves anything. Your documents never leave your Mac.