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

Enable annotation layer (text and link) #60

Open
zeecorleone opened this issue Apr 16, 2022 · 0 comments
Open

Enable annotation layer (text and link) #60

zeecorleone opened this issue Apr 16, 2022 · 0 comments

Comments

@zeecorleone
Copy link

How can the annotation layer be enabled in pdf.js being used? When try something like following:

 var promise = page.getAnnotations().then(function (annotationsData) {
        viewport = viewport.clone({
            dontFlip: true
        });

        for (var i = 0; i < annotationsData.length; i++) {
            var data = annotationsData[i];
            var annotation = PDFJS.Annotation.fromData(data);
            if (!annotation || !annotation.hasHtml()) {
                continue;
            }
            //. . . . code continues

This won't work, as it will break at PDFJS.Annotation.fromData(data) because PDFJS is no more available from version 2.0 onwards.

What I'm trying to do:
My goal is to enable links in pdf. for example, there are some links that point to a specific page within the same pdf document. Currently they aren't enabled. I tried to search and found that it could be enabled by enabling the annotation layer. But all examples I found related to enabling annotation layer are using PDFJS instance. Any help would be appreciated.

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

No branches or pull requests

1 participant