Skip to content

harskish/pdf.js

 
 

Repository files navigation

PDF.js for Science Papers

This is a fork of PDF.js with inline link previews for quickly exploring references and section/equation links. The preview feature is based on PDFRefPreview.

Getting the Code and Dependencies

  • Install Node.js 15.14.0 (v88, newest version that is supported by certain dependencies)
    • Install nvm, then run nvm install 15.14.0
  • Clone repository: git clone --recursive https://github.com/harskish/pdf.js.git
  • Install glup: npm install -g gulp-cli
  • Install dependencies: npm install --legacy-peer-deps

For more complete instructions, please refer to the upstream documentation.

Building the Browser Extensions

Chrome

  • gulp chromium: places extension in build/chromium
  • Open Chrome -> More Tools -> Extensions -> Developer Mode -> Load unpacked -> load folder build/chromium

Firefox

  • TODO

Running server for local development

It is also possible to view all test PDF files on the right side by opening: http:https://localhost:8888/test/pdfs/?frame

Usage

  • Open PDF in viewer. Only PDFs with embedded liks will work.
  • Press q to activate link preview functionality
  • Hover over a link (to section, equation, reference etc.), a pop-up preview will show up.

TODO

  • Align popup with bottom of link element to prevent flickering on downward mouse movement
  • Slight ~500ms delay to popup

Potential future features

  • Separately formatted previews for articles
    • Showing journal/conference name, authors, year etc.
    • Also add tests for parsing using real pdfs (or just strings)
  • ML-based detection of links in PDF that are missing them?

About

pdfj.js + inline link preview

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.7%
  • CSS 1.4%
  • Other 0.9%