-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[WIP] PDF Comments Extractor - New Feature, Help Needed #3300
base: master
Are you sure you want to change the base?
Conversation
As this seems to be a problem with webpack, perhaps upgrading to webpack 4 or even 2 might solve the issue? |
Have you tried using this configuration? |
I have, but there's a good chance I've missed something as I haven't had much experience with webpack configuration. using 'pdfjs-dist/webpack' works great on dev mode even without any further configuration. I've also followed this thread mozilla/pdf.js#7612 |
@ibraude sorry for the wait, can you resolve conflict and give me more information on the error you get when you try run it in production mode? |
@ibraude ping! |
@ZeroX-DG conflicts resolved. Regarding the error, I don't have any more information other than what's described in the initial comment. |
I've been investigate this for a while and still stuck with this. I'm not an expert in pdf.js, I'll try investigate more but it will take a bit longer. |
#New Feature - Help Needed
This is a PR referring to #3296.
I've started working on a new feature that is very useful for me and I thought it might be useful for other Boostnote users who read and summarize long texts.
The Feature
Import all annotations, highlights, and comments from a pdf file into a new Boostnote note.
For example:
I read a long document and highlight the main points as I go.
Then, instead of copy & pasting content to my summary in Boostnote, or constantly switching between windows, I can import the annotated pdf file to Boostnote:
This extracts all of the annotations from the pdf and opens a new note with the annotations in it.
This could be very useful for students or anyone that wants to summarize long texts.
Current behavior
This works perfectly in dev mode.
However, when I compile and build, webpack throws multiple errors. the build is complete but the functionality of the new feature does not work.
I have started investigating the issue and I found the changing "webpack-production-config.js" to load pdfjs using raw-loader solves the
Module Parse Failed
error as so:And I know that the following code in
node_modules/pdf-dist/build/pdf.js
is the section that causes theWARNING in ./~/pdfjs-dist/build/pdf.js Critical dependencies: 9858:6-13 require function is used in a way in which dependencies cannot be statically extracted @ ./~/pdfjs-dist/build/pdf.js 9858:6-13
error:The code:
However, I could not find a solution to this problem.
Expected behavior
Pdf annotation extractor feature will work in production mode as it does in dev mode
Steps to reproduce
3.Build Boosnote to see the error
If anyone has any ideas regarding this issue I will really appreciate it.
Also, I would like to hear if this is a feature that other users find useful and if so I will make sure to develop it further and make a PR.
Thanks a lot 🙏
my package.json: