Skip to content

Replace PDF.JS 2.x with 4.x. && Learn how to use Node Modules (ES6) on web #436

@DiegoPino

Description

@DiegoPino

What?

I am old(ish) and using .mjs is not as intuitive in a Drupal environment as expected. .mjs are "modules" and are loaded differently. And even if Drupal allows us to do so (with a hidden library property/subproperty) there is nothing that ensure that a module will be available (the exports) by the time Drupal's behaviors kick in.

So ... async magic/reading 4 hours of messages of cool kids using nodejs and I found a way. Why also upgrading?

Found out that PDF.JS (2.x, one we had) could not read PDFs with "small defects" like many coming from the Internet Archive and older repos. Now those work. Pull coming tomorrow

  • Updates: the most simplistic nav we have is not accessible and can be accessed via tabs too
  • Working on adding search: First PDF/JS native one using a different class. Then IIIF Content Search Driven (since this is rendering a canvas, I can render on top of it annotations)... and we can use the IIIF manifest a normal PDF would generate... more settings. This will lead to a "Search IIIF results component/element we can reuse in other viewers)
  • Add a wrapper around the rendered canvas. That way we can render FULL but also make the viewer less tall/less width and add scroll bars (this one for @alliomeria bc it allows me to add a grey background, more pdf-profesh right?)

Metadata

Metadata

Assignees

Labels

Field FormatterThe thing that glues the pieces and adds glitterJavascriptFavourite language of a PHP developerUI driven hintsShow stuff on screen so people have less guessing to doUXLike UI but with an XenhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions