Comments (12)
using
let PDFParser = require('electron').remote.require('pdf2json')
instead of
let PDFParser = require('pdf2json')
worked for me.
Thank you!
from pdf2json.
It works when you run it in the main process and not in any of the rendering process, and use the remote api to exchange data between them.
from pdf2json.
It should be possible to require it in a rendering process by: require('electron').remote.require(...)
from pdf2json.
from pdf2json.
how did you run pdf2json?
if you run it via cmd line, or as a web service, this error should not occur.
from pdf2json.
@modesty I ran in an electron app.
from pdf2json.
pdj2json is designed to run outside browser, and never tested with embedded browser (as in electron framework). 3 options here:
- invoke cmd line to run pdf2json from your app
- set globalScope.PDFJS.disableWorker to be true
- set PDFJS.workerSrc = Worker
from pdf2json.
@whitef0x0 @modesty It turns out that I have the same problem too. Any luck on running pdf2json in electron? Thanks...
from pdf2json.
@lanwin Thanks for your heads up. That works for me too...
from pdf2json.
@parzel Thanks for the explanation. I used it that way too...
from pdf2json.
@suparpat - can you please tell, what should I do to get the same PDFParser object in nwjs
app?
I'm getting the same issue, most probably it'll be the same solution.
However, I'm unable to load pdf2json
module correctly in nwjs
app.
from pdf2json.
It worked for me during development with electron:serve, after bundling the program with electron:build, opening the executable would cause the module not being found.
I did the correct way and moved my code to the main proccess.
from pdf2json.
Related Issues (20)
- TypeError: Cannot read property 'free' of undefined
- Text without spaces or line breaks HOT 4
- Boxes for Radio Buttons always return "checked": false
- Node.js Server got stuck when parsing specific PDF while it is working for other PDFs HOT 2
- fields with periods are truncated HOT 1
- TypeError: pdf2json_1.default is not a constructor HOT 3
- Property 'getRawTextContent' does not exist on type 'Pdfparser'.ts(2339) HOT 6
- The interface for `Line` is missing the `l` property HOT 1
- ENOENT: no such file or directory - util.js HOT 10
- How to detect the HLines correctly?
- Without a ToUnicode CMap, PDF viewers can't map glyphs to Unicode values -> rely on pdf.js?? HOT 2
- Characters coming as NULL HOT 1
- Is the auto-merge broken text blocks capability active in the last stable version (3.0.5)? HOT 1
- Cloudflare Worker issue with Could not resolve "fs/promises" HOT 5
- something is colossaly f***** up in the exports for version 3.1.0 HOT 2
- ENOENT: no such file or directory, open '/var/task/../package.json' HOT 2
- no such file or directory - pkinfo.js HOT 1
- PDF parse, edit and retain HOT 1
- Cannot compile project with 3.1.3 HOT 5
- All PDF Parsing fails after upgrading from v3.1.2 to v3.1.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf2json.