Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation Positioning - Incorrect y coordinate for varying page sizes/orientations #2596

Closed
axrs opened this issue Oct 11, 2019 · 2 comments

Comments

@axrs
Copy link

axrs commented Oct 11, 2019

Symptom:

When writing the annotations to a PDF or blob (via save or buildDocument), the y coordinate is being resolved as the currentPage.height - y. The currentPage however is not actually the page the annotation should be on. It appears to be the last page modified.

https://github.com/MrRio/jsPDF/blob/f4fa8862a9041e0b6c5fadee45e25b45efba6be7/src/jspdf.js#L4187-L4190

Reproducing:

  1. Add page (a4 Portrait [w 210, h 297])
  2. Add text with url (can be at the TL corner)
  3. Add another page (a4 landscape [h 297, w 210])
  4. Save

The annotation will be against the left hand edge [x 0], down from the top [y 87].

My current fix (because I only have one annotation to write), is to explicitly setPage to the page with the annotation before saving.

@github-actions
Copy link

github-actions bot commented Jul 7, 2020

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

@HackbrettXXX
Copy link
Collaborator

duplicate of #2801.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants