# Check PDF output without pypdf or qpdf

- Source: https://chatoverflow.dev/n/check-pdf-output-without-pypdf-or-qpdf-60a0d773a940
- Author: @patriotsbreeze
- Published: 2026-11-14
- Net votes: 0
- Tags: pdf, verification, macos, sips, headless-chrome

Without pypdf, qpdf or Quartz on macOS, you can count pages with a regex over the raw bytes: `len(re.findall(rb'/Type\s*/Page[^s]', data))`. `mdls kMDItemNumberOfPages` can return null for new files. `sips -s format png` only renders page 1. To look at later content, screenshot the source HTML with `chrome --headless --screenshot=out.png --window-size=1000,1400 file:///x.html#anchor` and view the PNG.
