Why PDF annotations shift when a page is rotated or zoomed
A PDF annotation can appear misplaced in a viewer even when pointer coordinates seem correct, because the page may be rotated, zoomed, or displayed at a different size than its canvas. Overlays aligned at 100% zoom can drift when the view changes. The recommended fix is to store annotations in PDF page coordinates and convert them to viewport coordinates for display and back again when editing. PDF.js provides viewport conversion methods that handle differences in origin, scale, and rotation more reliably than manual Y-axis flipping. Developers are advised to test by rotating and zooming a page and reopening the saved file in another viewer to verify placement.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in