Git Product home page Git Product logo

Comments (10)

mxs17 avatar mxs17 commented on August 11, 2024 1

Thanks! I missed the initial point about the "resolutions". I have tried it, and I see it works as expected when the dependencies are installed with yarn, but I cannot find a workaround for npm v.8 (I tried npm-force-resolutions in preinstall, but could not make it working).

from npm-pdfreader.

adrienjoly avatar adrienjoly commented on August 11, 2024

Thanks for the heads up!

Automated tests should have failed, if pdfreader does not work after that update… Any idea why they didn’t? 🤔

from npm-pdfreader.

Turtleb01 avatar Turtleb01 commented on August 11, 2024

This is really weird. If I git clone this repo and run npm i, it will install pdf2json 1.2.5, but if I start with an empty directory and run npm i pdfreader, it will install 1.3.1.

from npm-pdfreader.

Turtleb01 avatar Turtleb01 commented on August 11, 2024

I think I figured it out: it's package-lock.json. It sets pdf2json version to 1.2.5, but package-lock.json isn't shipped with the npm package. I'm not familiar with npm module best practices, but I don't think there should be any discrepancies between it and this repository.

from npm-pdfreader.

adrienjoly avatar adrienjoly commented on August 11, 2024

Good catch!

Unfortunately, I found out that npm does not publish package-lock.json, as stated on npm docs:

package-lock.json cannot be published, and it will be ignored if found in any place other than the root project.

That said, if pdf2json refuse to create a major version (which would be the right thing to do, considering that their recent change is a breaking one), this could be a workaround worth trying:

In contrast, npm-shrinkwrap.json allows publication, and defines the dependency tree from the point encountered.

Feel free to give it a try and propose a Pull Request if this solution solves your problem!

Adrien

from npm-pdfreader.

adrienjoly avatar adrienjoly commented on August 11, 2024

I just fixed the version of pdf2json to 1.2.5 (instead of ^1.2.5), as an attempt to prevent it from being upgraded when installing pdfreader as a dependency of a Node.js project: bbf2e22

Does this fix your problem, by any chance?

from npm-pdfreader.

mxs17 avatar mxs17 commented on August 11, 2024

Hi Adrien!

I have bumped into a new problem with pdf2json of nearest versions. I have a set of PDFs (hundreds of them) that were successfully imported earlier, I believe, around pdfreader's version 1.2.8. Now, I am trying to import them again, and for some files the process of import ends silently in 3-4 seconds with no errors and no callbacks invocation. I tried all the versions one by one - no luck.

I have just checked pdf2json repo, and I see a new major version 2.0.0 released 3 days ago. It somehow parses these files again. :)

Is it possible to release some minor update of pdf2reader with pdf2json 2.0.0?

UPD: Version1.3.1 of pdf2json also works for me.
UPD2: Okay, these are breaking changes, and patches will not work. :)
UPD3: I researched it a bit and found that import process is blocked by logo images on the pages. After removing images, the file was successfully imported both by 1.2.8 and 1.2.13.

from npm-pdfreader.

adrienjoly avatar adrienjoly commented on August 11, 2024

FYI, @k2s proposed a fix that may make pdfreader compatible with pdf2json 2.0: https://github.com/adrienjoly/npm-pdfreader/releases/tag/v1.2.14

Check it out and please let us know if it works, when it's available on npm.

from npm-pdfreader.

mxs17 avatar mxs17 commented on August 11, 2024

I have installed 1.2.14 from npm, and I see pdf2json 1.2.5 in package-lock.json. So, it still silently does nothing with my test file. Is there a way to specify the version of pdf2json on my side?

UPD: fork from 1.2.14 where pdf2json version is changed to 2.0.0 works for me.

from npm-pdfreader.

adrienjoly avatar adrienjoly commented on August 11, 2024

Have you tried specifying a different version of pdf2json in the "resolutions" section of package.json yet, as proposed there: #97 ?

from npm-pdfreader.

Related Issues (20)

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.