Fix multipage pdf output.

I guess this isn't used very much (and I haven't used it in a while), but this patch reenables multipage pdf output and updates the (internal) interface slightly.