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

PDF.js media viewers does not respect links #8

Open
igorbga opened this issue Jun 17, 2013 · 7 comments
Open

PDF.js media viewers does not respect links #8

igorbga opened this issue Jun 17, 2013 · 7 comments
Assignees
Milestone

Comments

@igorbga
Copy link

igorbga commented Jun 17, 2013

When the PDF.js media viewer shows a document, if the document has links those do not work. In flash preview you could click on the embedded links without any problems.

I have checked a sample document with mozilla's PDF.js demo and they work so I think it must be an issues with the Share Extras integration.

@ghost ghost assigned loftux Jun 17, 2013
@loftux
Copy link
Member

loftux commented Jun 17, 2013

Could you please try and check out and build the pdfjs branch?
It has a fairly recent version of pdf.js library, so if it works on their demo page it will hopefully work in Media Viewers too.

@igorbga
Copy link
Author

igorbga commented Jun 17, 2013

I've changed to branch pdf.js, downloaded it, opened in eclipse and build ANT target "dist-jar". I have replaced the media viewers jar with the resulting one.

But it seems there is some bug in the Javascript code as the previewer says that it can not download PDF content and the Javascript Console shows some errors in the minimized JS:

Uncaught TypeError: Property 'progressCallback' of object # is not a function pdf-min.js:1
Unhandled rejection: TypeError: Cannot read property 'name' of undefined

@loftux
Copy link
Member

loftux commented Jun 17, 2013

Did you build using ant -f project.xml dist-jar ?
If not, that is probably why (we cannot compress pdf.js with yuicompress due to a bug).
If you did, please specify what browser and version you are seeing this error.

@igorbga
Copy link
Author

igorbga commented Jun 17, 2013

a ok, didn't know that. I've tried again after building as you mentioned.

Building this way the ant output shows still a task called yuicompress running but now the viewer loads and the document is shown. Nevertheless "TypeError: this.progressCallback is not a function" in line 226 of pdf-min.js is still shown in the javascript console. And the links don't work either, so it seems like pdfjs branch does not solve the problem.

I've tested it with several browsers and all of them behave in the same way:

  • Mozilla Firefox 21 in Ubuntu 12.04 64bit
  • Chromium Versión 25.0.1364.160 Ubuntu 12.04 (25.0.1364.160-0ubuntu0.12.04.1)
  • Mozilla Firefox 21 in Windows XP
  • Chrome 27.0.1453.110 in Windows XP

I'm running in Alfresco Community 4.0.d.

@igorbga
Copy link
Author

igorbga commented Jun 17, 2013

The javascript error, might be related to this ? mozilla/pdf.js#3368

@loftux
Copy link
Member

loftux commented Jun 17, 2013

Thanks for spotting that pdf.js issue. I was able to replicate it, and will add this fix as soon as it is merged in the pdf.js project.
You can if you want to enable progressive loading, I've not enable it by default. Change row 753 in PdfJs.js to: PDFJS.disableRange = false;
That should probable remove the error.
Its a new feature, if you enabled it and find issue, please report in issue #1.

As for hyperlinking support, this must be implemented separately, a quick check in pdf.js project and their viewer implementation viewer.js tells that it does need to be implemented in the viewer (it is not part of core library). I'll keep this issue open as an enhancement request.

@igorbga
Copy link
Author

igorbga commented Jun 17, 2013

Great, thanks.

loftux added a commit that referenced this issue Jun 20, 2013
Also handles the error discovered in pdf.js while investigating #8
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