Pdf.js: PDF.JS not working on safari

Created on 10 Oct 2013  路  9Comments  路  Source: mozilla/pdf.js

PDF.js is not working on my safari 5.1.0. Even the demo does not work. Error in the console is as follows.

thumbs is undefined.

l10n.js:877#thumbs is undefined.
l10n.js:794#thumbs_label is undefined.
l10n.js:877#thumbs_label is undefined.
l10n.js:794#outline is undefined.
l10n.js:877#outline is undefined.
l10n.js:794#outline_label is undefined.
l10n.js:877#outline_label is undefined.
l10n.js:794#find_label is undefined.
l10n.js:877#find_label is undefined.
l10n.js:794#find_previous is undefined.
l10n.js:877#find_previous is undefined.
l10n.js:794#find_previous_label is undefined.
l10n.js:877#find_previous_label is undefined.
l10n.js:794#find_next is undefined.
l10n.js:877#find_next is undefined.
l10n.js:794#find_next_label is undefined.
l10n.js:877#find_next_label is undefined.
l10n.js:794#find_highlight is undefined.
l10n.js:877#find_highlight is undefined.
l10n.js:794#find_match_case_label is undefined.
l10n.js:877#find_match_case_label is undefined.
l10n.js:794#presentation_mode is undefined.
l10n.js:877#presentation_mode is undefined.
l10n.js:794#presentation_mode_label is undefined.
l10n.js:877#presentation_mode_label is undefined.
l10n.js:794#open_file is undefined.
l10n.js:877#open_file is undefined.
l10n.js:794#open_file_label is undefined.
l10n.js:877#open_file_label is undefined.
l10n.js:794#print is undefined.
l10n.js:877#print is undefined.
l10n.js:794#print_label is undefined.
l10n.js:877#print_label is undefined.
l10n.js:794#download is undefined.
l10n.js:877#download is undefined.
l10n.js:794#download_label is undefined.
l10n.js:877#download_label is undefined.
l10n.js:794#bookmark is undefined.
l10n.js:877#bookmark is undefined.
l10n.js:794#bookmark_label is undefined.
l10n.js:877#bookmark_label is undefined.
l10n.js:794#first_page is undefined.
l10n.js:877#first_page is undefined.
l10n.js:794#first_page_label is undefined.
l10n.js:877#first_page_label is undefined.
l10n.js:794#last_page is undefined.
l10n.js:877#last_page is undefined.
l10n.js:794#last_page_label is undefined.
l10n.js:877#last_page_label is undefined.
l10n.js:794#page_rotate_cw is undefined.
l10n.js:877#page_rotate_cw is undefined.
l10n.js:794#page_rotate_cw_label is undefined.
l10n.js:877#page_rotate_cw_label is undefined.
l10n.js:794#page_rotate_ccw is undefined.
l10n.js:877#page_rotate_ccw is undefined.
l10n.js:794#page_rotate_ccw_label is undefined.
l10n.js:877#page_rotate_ccw_label is undefined.
l10n.js:794#toggle_sidebar is undefined.
l10n.js:877#toggle_sidebar is undefined.
l10n.js:794#toggle_sidebar_label is undefined.
l10n.js:877#toggle_sidebar_label is undefined.
l10n.js:794#findbar is undefined.
l10n.js:877#findbar is undefined.
l10n.js:794#findbar_label is undefined.
l10n.js:877#findbar_label is undefined.
l10n.js:794#previous is undefined.
l10n.js:877#previous is undefined.
l10n.js:794#previous_label is undefined.
l10n.js:877#previous_label is undefined.
l10n.js:794#next is undefined.
l10n.js:877#next is undefined.
l10n.js:794#next_label is undefined.
l10n.js:877#next_label is undefined.
l10n.js:794#page_label is undefined.
l10n.js:877#page_label is undefined.
l10n.js:794#presentation_mode is undefined.
l10n.js:877#presentation_mode is undefined.
l10n.js:794#presentation_mode_label is undefined.
l10n.js:877#presentation_mode_label is undefined.
l10n.js:794#open_file is undefined.
l10n.js:877#open_file is undefined.
l10n.js:794#open_file_label is undefined.
l10n.js:877#open_file_label is undefined.
l10n.js:794#print is undefined.
l10n.js:877#print is undefined.
l10n.js:794#print_label is undefined.
l10n.js:877#print_label is undefined.
l10n.js:794#download is undefined.
l10n.js:877#download is undefined.
l10n.js:794#download_label is undefined.
l10n.js:877#download_label is undefined.
l10n.js:794#bookmark is undefined.
l10n.js:877#bookmark is undefined.
l10n.js:794#bookmark_label is undefined.
l10n.js:877#bookmark_label is undefined.
l10n.js:794#tools is undefined.
l10n.js:877#tools is undefined.
l10n.js:794#tools_label is undefined.
l10n.js:877#tools_label is undefined.
l10n.js:794#zoom_out is undefined.
l10n.js:877#zoom_out is undefined.
l10n.js:794#zoom_out_label is undefined.
l10n.js:877#zoom_out_label is undefined.
l10n.js:794#zoom_in is undefined.
l10n.js:877#zoom_in is undefined.
l10n.js:794#zoom_in_label is undefined.
l10n.js:877#zoom_in_label is undefined.
l10n.js:794#zoom is undefined.
l10n.js:877#zoom is undefined.
l10n.js:794#page_scale_auto is undefined.
l10n.js:877#page_scale_auto is undefined.
l10n.js:794#page_scale_actual is undefined.
l10n.js:877#page_scale_actual is undefined.
l10n.js:794#page_scale_fit is undefined.
l10n.js:877#page_scale_fit is undefined.
l10n.js:794#page_scale_width is undefined.
l10n.js:877#page_scale_width is undefined.
l10n.js:794#first_page is undefined.
l10n.js:877#first_page is undefined.
l10n.js:794#last_page is undefined.
l10n.js:877#last_page is undefined.
l10n.js:794#page_rotate_cw is undefined.
l10n.js:877#page_rotate_cw is undefined.
l10n.js:794#page_rotate_ccw is undefined.
l10n.js:877#page_rotate_ccw is undefined.
l10n.js:794#error_more_info is undefined.
l10n.js:877#error_more_info is undefined.
l10n.js:794#error_less_info is undefined.
l10n.js:877#error_less_info is undefined.
l10n.js:794#error_close is undefined.
l10n.js:877#error_close is undefined.
l10n.js:794#password_label is undefined.
l10n.js:877#password_label is undefined.
l10n.js:794#password_cancel is undefined.
l10n.js:877#password_cancel is undefined.
l10n.js:794#password_ok is undefined.
l10n.js:877#password_ok is undefined.
Warning: Setting up fake worker.
pdf.js:4356TypeError: 'undefined' is not an object (evaluating 'PDFJS.WorkerMessageHandler.setup')

4-information-requested 4-safari-specific 5-good-beginner-bug

All 9 comments

Please provide more information on which operating system you're using and if these errors occur locally or also with the viewer on http://mozilla.github.io/pdf.js/web/viewer.html.

It might also be related to #3760 if you're using Windows.

Thanks, I was using safari on Mac osx 10.6.8. The errors occur on the viewer. It also have some other problems locally and on safari of ios7.

I tried out the current code on master branch and I'm getting following error from viewer when load the page in qt Webkit (AppleWebkit/534.34)

TypeError: 'undefined' is not an object (evaluating 'PDFJS.WorkerMessageHandler.setup')

  http://localhost:8888/src/display/api.js:611 in WorkerTransport_setupFakeWorker
  http://localhost:8888/src/display/api.js:545 in transportTest
  http://localhost:8888/web/compatibility.js:310 in functionPrototypeBindBound
  http://localhost:8888/src/shared/util.js:1047 in messageHandlerComObjOnMessage

Is this the same thing as this error.

Warning: Setting up fake worker. pdf.js
Warning: Unhandled rejection: TypeError: Cannot call method 'setup' of undefined
TypeError: Cannot call method 'setup' of undefined
at Object.WorkerTransport_setupFakeWorker [as setupFakeWorker]

This happens even though I have

PDFJS.disableWorker = false;

Using Chrome and FF (latest).

Why does it still try to setup fake workers even though I have it set to false?

Same issue here. Tested on:

  • Ubuntu 12.04

    • Chromium 30

    • UX 28.0a1

  • OSX

    • Chrome 31.0

With PDFJS.disableWorker = true

line 4697: PDFJS.WorkerMessageHandler is undefined therefore setup fails

With PDFJS.disableWorker = false the document is not loaded and none of the callbacks in PDFJS.getDocument(url).then(success, fail) are called.

Is this still an issue?

I think this issue has been resolved. I ran into the error but fixed it by
updating the library.

On Tuesday, March 18, 2014, Tim van der Meij [email protected]
wrote:

Is this still an issue?

Reply to this email directly or view it on GitHubhttps://github.com/mozilla/pdf.js/issues/3797#issuecomment-37999776
.

I am using IOS7.1.1 pdf.js is opening very slow . Even i tried the sample too. Its getting loaded finally but it take time. Can you let me know why it is happening. This is happening the especially in IOS7. But its works well in IOS8 and Ipads.

Eventhough i have minified the pdf.js and pdf.worker.js, but is its same issue.

Please suggest how to fix this?

This issue is occurring because pdf worker js is not loaded before pdf.js.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hp011235 picture hp011235  路  4Comments

azetutu picture azetutu  路  4Comments

sujit-baniya picture sujit-baniya  路  3Comments

BrennanDuffey picture BrennanDuffey  路  3Comments

zerr0s picture zerr0s  路  3Comments