2019
PDFNumber
A LaTeX and ImageMagick script to add line numbers to any PDF.

A LaTeX and ImageMagick Script to add line numbers to any PDF. Based on the work in tex.stackexchange.com/a/18776.
Usage
Place your pdf in the same folder as the two scripts and rename it Script.pdf.
Run sh ./findlines.sh Script to generate the files for NumberPDF.tex.
Variables
Edit the following in NumberPDF.tex to customize your numbering:
\numpages=62The total number of pages in the PDF.\numberby=2Count by 2s, or whatever number you’d like.\startnumbering=2Start numbering after n lines. Useful for skipping headers in pdfs.\offset=10Offset of numbers from left margin. Useful numbers are in the range of 0–20ish.
Requirements
Requires ImageMagick commandline tools, and LaTeX.