Skip to content

Programming notes

Hilaire Fernandes edited this page Mar 16, 2026 · 7 revisions

PDF import

Use CLI tools to process the conversion of a PDF document to a collection of JPEG bitmap. The poppler-utils package provides the appropriate tools to be executed in a host shell command.

pdftocairo or pdftoppm

To extract page 10 as JPEG with quality at 90%, on a file named math-010.jpg:

pdftocairo -jpeg -jpegopt quality=90 -f 10 -l 10 Mathematiques.pdf  math

Number of pages of a PDF document

Write the number of pages of the PDF document in the file pages.

pdfinfo textbook1.pdf | grep Pages | cut -d: -f2 | sed s/\ //g > pages

Mouse coordinates from Bash

while true; do clear; xdotool getmouselocation; sleep 0.1; done

Clone this wiki locally