I've done the same thing before on a book in college, except my DRM wasn't nice enough to let me print 10 pages at a go. Instead, I spun up a virtual X server with Xdummy with a resolution of 1200x10000. That showed a few dozen pages at a time. Then I automated screenshots (scrot) and PageDown (xdotool). Finally, some PIL magic to look for the thin gray line between pages plus convert and ghostscript and I had a PDF!