Add line numbers to PDF
January 6, 2012 3:08 PM   Subscribe

How can I add line numbers to a PDF?

I have a large collection of PDFs that I need to add line numbers to, like they are galley proofs or legal documents. Someone on my team figured out a way to do it manually, but it takes about 1 to 2 hours per document, which is untenable. Is there an easy way to do this? I don't have access to the original files, only to PDFs.

I've submitted articles to journals in the past, and when they create the PDF for you they add line numbers down the left hand side of the page, so I know this is possible at least in theory. What do I need to do to make it happen? If it requires scripting, can the explanation be dumbed down so that I can understand how to actually implement it? I'm an OK programmer and am good with computers, but I don't have much experience with scripting.

I have access to three operating systems: Windows 7, Mac, and Linux machine running Ubuntu. It would be best if this solution worked on Windows.
posted by k8lin to Computers & Internet (6 answers total) 2 users marked this as a favorite
 
Is the line spacing 100% consistent on each page of every PDF?
posted by Brian Puccio at 3:13 PM on January 6, 2012


Response by poster: No, Brian, but that doesn't matter - thanks for asking for the clarification, and I'm sorry I didn't include this in the original question.

What we want is a way to approximate the line number something is on, so that it's like a galley proof. For example, I could say "between line 14 and 15" if the text doesn't line up with the numbers exactly.
posted by k8lin at 3:18 PM on January 6, 2012


Best answer: Given that, it sounds like you want to create a pdf that has line numbers in it, and then overlay it onto your pdfs. I'd check out, say, this stack overflow question.
posted by inkyz at 3:31 PM on January 6, 2012 [2 favorites]


What we want is a way to approximate the line number something is on, so that it's like a galley proof. For example, I could say "between line 14 and 15" if the text doesn't line up with the numbers exactly.

In that case, you can come up with any metric you want. For example, do the mental exercise of lining up an imaginary ruler next to a page and referencing it as "page I, distance J".

This could be done with or without computers. Without a computer, just hand out rulers to readers and you're done. With a computer, think about adding a watermark to each page of a PDF, with the watermark being a ruler or other device that consistently shows the metric you've decided on.
posted by Blazecock Pileon at 3:34 PM on January 6, 2012


Are the PDFs static images or text based?
posted by lampshade at 6:30 PM on January 6, 2012


Just wanted to post back in here and say that as long as you don't mind the numbering being consistent on each page, regardless of where the content actually is, then something like inkyz's solution is what I'd say as well.

Good luck, post more if you need help.
posted by Brian Puccio at 10:21 AM on January 7, 2012


« Older Alone in the middle of a crowd   |   Can I make ravioli from these lasagna sheets? Newer »
This thread is closed to new comments.