sayanee / angularjs-pdf

:page_facing_up: An AngularJS directive <ng-pdf> to display PDF files with PDFJS
http://sayan.ee/angularjs-pdf/
MIT License
494 stars 248 forks source link

Links within pdfs not working? #200

Closed mobpakrd closed 7 years ago

mobpakrd commented 7 years ago

Hello, We have implemented angularjs-pdf and things are generally working well except that links in pdfs are not clickable. They just render without being links. I've attached a pdf with links that works fine in pdf-js but in our app does not work. We are currently using version 1.5.5 of angularjs-pdf. https://mozilla.github.io/pdf.js/web/viewer.html Additionally the demo at https://sayan.ee/angularjs-pdf/ appears to have links in it, for instance footnotes, and a mailto that are simply appear blue without being clickable. Is this a known issue with angularjs-pdf or do links work for others and perhaps something about our implementation is screwing it up? Below is where things are included, I can provide further details if needed.

            <ng-pdf
                    template-url="components/file_view/pdf_viewer.tpl.html"
                    canvasid="pdf"
                    scale="page-fit">
            </ng-pdf>

pdf_viewer.html:

{{loading}}
<canvas id="pdf" class="rotate0"></canvas>

sample_pdf.pdf

dennybiasiolli commented 7 years ago

Hi @mobpakrd, unfortunately this directive display pdfs without the text layer, so links are not clickable. If you have some spare time, any helps and PR will be appreciated 😄

mobpakrd commented 7 years ago

@dennybiasiolli if I were to go about making that change, how would you recommend going about it? Are there perhaps other libraries that do handle the text layer that I could look at? I'm not super familiar with pdfs but this is an important thing for us so if it's not overwhelming you might be a looking at a pr not too far away.

dennybiasiolli commented 7 years ago

@mobpakrd a good starting point is in pdf.js code, something like the link you posted: https://mozilla.github.io/pdf.js/web/viewer.html 😉