Giter Site home page Giter Site logo

pdfjs-dist's People

Contributors

bennyalex avatar dependabot[bot] avatar gpbmike avatar robrez avatar ryan-miller-highspot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pdfjs-dist's Issues

Update dependencies and publish latest pdfjs-dist v2.13.216

This repo is currently behind the latest version of pdfjs-dist by several minor versions: v2.5.207 vs. current v2.13.216. We should update to the latest version of pdfjs-dist and other dependencies; hopefully in doing so, things are ironed out so that upgrades are just a matter of running npm run build.

I attempted to just update pdfjs-dist to the latest, but this gave an error during the build step due to optional chaining not supported in the older v1.x version of Rollup. I then updated rollup and all other dev depdencies (see package.json), but am getting this other error now:

./src/core/pdf.js โ†’ ./build/pdf.js...
[!] (plugin at position 5) SyntaxError: Unexpected token (1376:26) in pdfjs-dist\node_modules\pdfjs-dist\build\pdf.js
SyntaxError: Unexpected token (1376:26) in pdfjs-dist\node_modules\pdfjs-dist\build\pdf.js
    at Parser.pp$4.raise (pdfjs-dist\node_modules\acorn\dist\acorn.js:2757:13)
    at Parser.pp.unexpected (pdfjs-dist\node_modules\acorn\dist\acorn.js:647:8)
    at Parser.pp$3.parseExprAtom (pdfjs-dist\node_modules\acorn\dist\acorn.js:2196:10)
    at Parser.pp$3.parseExprSubscripts (pdfjs-dist\node_modules\acorn\dist\acorn.js:2047:19)
    at Parser.pp$3.parseMaybeUnary (pdfjs-dist\node_modules\acorn\dist\acorn.js:2024:17)
    at Parser.pp$3.parseExprOps (pdfjs-dist\node_modules\acorn\dist\acorn.js:1966:19)
    at Parser.pp$3.parseMaybeConditional (pdfjs-dist\node_modules\acorn\dist\acorn.js:1949:19)
    at Parser.pp$3.parseMaybeAssign (pdfjs-dist\node_modules\acorn\dist\acorn.js:1925:19)
    at Parser.pp$3.parseMaybeConditional (pdfjs-dist\node_modules\acorn\dist\acorn.js:1954:28)
    at Parser.pp$3.parseMaybeAssign (pdfjs-dist\node_modules\acorn\dist\acorn.js:1925:19)

I suspect it's some incompatibility with a plugin, but I'm new to rollup, so don't know where to begin in troubleshooting this. The fork I'm working with is here: https://github.com/Lukenickerson/pdfjs-dist

Bundling with Rollup (Stencil.js) produces error

Using latest stencil.js to create webcomponent for rendering pdf document unsuccessful, Rollup is unable to pack:

[ ERROR ]  Rollup: Plugin Error: ../../../node_modules/@bundled-es-modules/pdfjs-dist/build/pdf.js:15011:3
           Unexpected token (15011:3) in
           /[...redacted..]/node_modules/@bundled-es-modules/pdfjs-dist/build/pdf.js (plugin:
           commonjs, transform)

  L15010:    }
  L15011:    return success;
  L15012:  }

Missing PDFViewerApplication, PDFViewerApplicationOptions exports from web/pdf_viewer.js?

I'm trying to use (a customised version of) the viewer application as mentioned here. However, I think that the current build is missing exports for:

  • PDFViewerApplication
  • PDFViewerApplicationOptions
  • probably getViewerConfiguration()
  • possibly webViewerLoad()

which are also from https://github.com/mozilla/pdf.js/blob/master/web/viewer.js. I'm a noob when it comes to JS packaging so if I have got hold of the wrong end of the stick a hint as to how to get to those objects would be most welcome. (I have managed to get hold of, for example, PDFViewer).

Error in babelify

I have an error using browserify babelify

"browserify": "16.3.0",

"@babel/core": "7.10.4",
"@babel/polyfill": "7.10.4",
"@babel/preset-env": "7.10.4",

And I'm having the following error
Error: Parsing file XXX/node_modules/@bundled-es-modules/pdfjs-dist/build/pdf.js: 'import' and 'export' may appear only with 'sourceType: module' (27612:0)

I'm able to fix this changing last line of build/pdf.js from export default pdf_1; to module.exports = pdf_1;
Any change of changing this?

Cannot create PDFThumbnailViewer instance

I use below code to create PDFThumbnailViewer object,

import PDFViewer from "@bundled-es-modules/pdfjs-dist/web/pdf_viewer"; let pdfThumbnailViewer = new PDFViewer.PDFThumbnailViewer({ container: this.thumbnailView, renderingQueue: this.pdfViewer.renderingQueue, linkService: this.pdfLinkService });

At runtime , exception throw
Unhandled Promise rejection: Uncaught (in promise): TypeError: bundled_es_modules_pdfjs_dist_web_pdf_viewer__WEBPACK_IMPORTED_MODULE_2_.default.PDFThumbnailViewer is not a constructor
TypeError: bundled_es_modules_pdfjs_dist_web_pdf_viewer__WEBPACK_IMPORTED_MODULE_2_.default.PDFThumbnailViewer is not a
constructor

Look inside file "https://github.com/bundled-es-modules/pdfjs-dist/blob/master/web/module.js", I don't see the implement for class PDFThumbnailViewer. The original for class PDFThumbnailViewer at https://github.com/mozilla/pdf.js/blob/master/web/pdf_thumbnail_viewer.js

Doesn't work with ArrayBuffer

I was using the OG pdfjs-dist but had some issues with Vite, so I switched to this one. However, there seems to be something off because now I'm getting ReferenceError: document is not defined error when I try to load PDF as ArrayBuffer with pdfjs.getDocument({ data: pdfData, disableAutoFetch: true }).

Add pdf-viewer.js to the build

Hi, we have been evaluating this project to get ES module version of pdf.js in order to make a web component wrapper for it. So I would like to request a build for pdf-viewer.js (currently missing).

I'm going to try updating the Rollup config to make this happen, and then submit a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.