PDF plugin: Optimize the handling of cross-page selections. Closes #29.