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

Upgrade PDF.js in Via and the browser extension #366

Closed
robertknight opened this issue Sep 19, 2017 · 11 comments
Closed

Upgrade PDF.js in Via and the browser extension #366

robertknight opened this issue Sep 19, 2017 · 11 comments

Comments

@robertknight
Copy link
Member

We are currently shipping PDF.js v1.1.215 (June 2015) with the browser extension and v1.1.24 (~ March 2015) with Via. This means that we are missing out on 2+ years worth of PDF compatibility improvements, bug fixes and performance improvements.

I did try upgrading PDF.js not long ago but ran into issues anchoring existing annotations described in hypothesis/browser-extension#12 , which need to be investigated and resolved.

@robertknight
Copy link
Member Author

@felliott
Copy link

Around the beginning of July 2018, pdf.js removed the PDFViewerApplication.documentFingerprint property the client uses to get the document identifier. See mozilla/pdf.js@e522b2d

@robertknight
Copy link
Member Author

Thanks for the notice @felliott.

@gavento
Copy link

gavento commented Dec 29, 2018

As of 12-2018, the PDFJS version bundled in Firefox 64.0 (on Ubuntu 18.04 64bit) is PDF.js: 2.0.936.

(The PDFJS versions in Via and the Chrome browser extension are still 1.1.24 and 1.1.215 respectively).

The API changes seem to be substantial in volume, but hopefully not in depth (see the diff of api.js in the tab Files Changed). Unfortunately, there is no comprehensive overview of the changes to 2.0 (or even among the 1.x minor revisions), only examples update.

@gavento
Copy link

gavento commented Dec 29, 2018

There are few more issues across the Hypothesis project related to the PDF.js update:
hypothesis/via#81
hypothesis/browser-extension#12
hypothesis/client#259
hypothesis/pdf.js-hypothes.is#14

@gavento
Copy link

gavento commented Dec 29, 2018

@robertknight I would be curious in your opinion on what is the biggest blocker in upgrading PDF.js: Is it the anchoring issues between PDF.js versions (e.g. hypothesis/browser-extension#12) or technical issues with recent PDF.js API changes / incompatibilities?

@robertknight
Copy link
Member Author

Hi @gavento - making sure that annotations that anchored with older versions of PDF.js still anchor after we update the copy in the browser extension and Via is the main concern. The Hypothesis client's "fuzzy anchoring" algorithm is not sufficiently robust to some of the typical changes in text output between older and newer PDF.js versions. For example, changes in where spaces appear in the text layer.

PDF.js API changes haven't posed a major issue.

@JamesPJ
Copy link

JamesPJ commented Mar 5, 2019

I was trying to upgrade the PDF.js to 2.x version. But, I'm facing issue with the frame syncing. The addFrame function is never getting called, due to this Redux store is having empty frame state. I can see the addFrame is attached tobridge.onConnect(addFrame);. I'm having difficulty in understanding this portion of implementation. Can anyone explain when the Redux store should update with frame data and on what condition we are triggering the postMessage to the frame-sync.

@robertknight
Copy link
Member Author

Hello @JamesPJ -

PDF.js is not part of the client. Are you trying to use a newer version of PDF.js in the browser extension, Via or with a different tool?

The Hypothesis client already supports recent versions of PDF.js, at least the version shipped with the stable release of Firefox (2.1.97). You shouldn't need to make any code changes to the client to use it with that version.

If you are trying to build your own version of the client for whatever reason, I would suggest to start with getting the simplest configuration working, which is the client's development server at http://localhost:3000.

@JamesPJ
Copy link

JamesPJ commented Mar 5, 2019

@robertknight Thank you for the quick response. Yes, I was trying the new PDF.js version with the browser extension base by combining the features of client. Let me check whether client alone works for me.

@klemay
Copy link

klemay commented Aug 8, 2019

Closing in favor of hypothesis/via#81

@klemay klemay closed this as completed Aug 8, 2019
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

5 participants