Fixed an issue in which pdf links were duplicated on other pages

The anchor elements are added to every page in the PDF.  In some circumstances this caused them to show up on other pages, hanging off the top or bottom of the pages.

This fix first checks the bounds of the box associated with the link, and only puts it on the page if it overlaps the page.