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

Add hyperlinks #1691

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add hyperlinks #1691

wants to merge 3 commits into from

Conversation

bluehaoran
Copy link

@bluehaoran bluehaoran commented Oct 22, 2024

What?

Adds PDFPage.drawLink() so users can add hyperlinks easily.

Why?

I personally needed to add several hyperlinks to a PDF. I added createPageLinkAnnotation per the suggestion in #555, got it working in our project, and then generalised it for broader use.

See also: #555, #691 , #980

How?

This follows @Hopding 's suggestion in #555.

I dug into the PDF Specification to double-check the possible setting for Border and Colour.

I have not provided all possible options; I wanted something simple and working before adding extra options.

Testing?

Added basic Unit test in PDFPage.spec.ts.

New Dependencies?

No.

Screenshots

Suggested Reading?

Yes, read the PDF Spec.

Anything Else?

Nope.

Checklist

  • I read CONTRIBUTING.md.
  • I read MAINTAINERSHIP.md#pull-requests.
  • I added/updated unit tests for my changes.
  • [] I added/updated integration tests for my changes.
  • [] I ran the integration tests.
  • I tested my changes in Node, Deno, and the browser.
  • I viewed documents produced with my changes in Adobe Acrobat, Foxit Reader, Firefox, and Chrome.
  • I added/updated doc comments for any new/modified public APIs.
  • My changes work for both new and existing PDF files.
  • I ran the linter on my changes.

@bluehaoran
Copy link
Author

PS: the CircleCI build seems to be broken.

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

Successfully merging this pull request may close these issues.

1 participant