simonegosetto / pdf-parse-new

Pure javascript cross-platform module to extract texts from PDFs.
MIT License
8 stars 3 forks source link

Error: No "GlobalWorkerOptions.workerSrc" specified. #5

Open yajiviki opened 1 month ago

yajiviki commented 1 month ago

I have tried to extract the text contents from the PDF using 'pdf-parse-new in Adobe UXP Plugin and I'm getting an error message below Code :


try {
              const fs = require("fs");
            const pdf = require("pdf-parse-new");
                let thePDFfile="example.pdf"
            let dataBuffer = fs.readFileSync(thePDFfile); //fs.readFileSync(thePDFfile);

        await pdf(dataBuffer).then(function (data: any) {

            // number of pages
            console.log(data.numpages);
            // number of rendered pages
            console.log(data.numrender);
            // PDF info
            console.log(data.info);
            // PDF metadata
            console.log(data.metadata);
            // PDF.js version
            // check https://mozilla.github.io/pdf.js/getting_started/
            console.log(data.version);
            // PDF text
            console.log(data.text);

        });
    } catch (er) {
        console.log(er);
    }

Error: No "GlobalWorkerOptions.workerSrc" specified. at Function.get workerSrc [as workerSrc] (VM19 scripts-uxp.js:49797) at PDFWorker._initialize (VM19 scripts-uxp.js:49680) at new PDFWorker (VM19 scripts-uxp.js:49641) at Object.getDocument (VM19 scripts-uxp.js:48708) at PDF (VM19 scripts-uxp.js:31899) at main (VM19 scripts-uxp.js:376766) at fceToRun (VM12 uxp.js:220591) at CustomScripts.applyDefaultSettingsAndRun (VM12 uxp.js:220656) at CustomScripts._executeScriptOnce (VM12 uxp.js:220610) at CustomScripts.executeScriptOnce (VM12 uxp.js:220566) at photoshop__WEBPACK_IMPORTED_MODULE_1__.core.executeAsModal.commandName (VM12 uxp.js:220543) at _internalExecuteAsModalWrapper (uxp://uxp-internal/ps-common.js:61) at _internalCallbackWrapper (uxp://uxp-internal/ps-common.js:42)

simonegosetto commented 4 weeks ago

@yajiviki can you try to install "npm install pdf-parse-new@beta" and give me feedback? is it's ok i can release the v1.3.9

yajiviki commented 4 weeks ago

Simone Gosetto, Sure I'll check and let you know

Warm Regards, VIJAY

Vijay Anand Natrajan - Developer of Imaging and Workflow Automation www.bright-river.com @.***

On Wed, 30 Oct 2024 at 22:27, Simone Gosetto @.***> wrote:

@yajiviki https://github.com/yajiviki can you try to install "npm install @.***" and give me feedback? is it's ok i can release the v1.3.9

— Reply to this email directly, view it on GitHub https://github.com/simonegosetto/pdf-parse-new/issues/5#issuecomment-2447808944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOUSCUC7LECTV7P472IF7TZ6EFZDAVCNFSM6AAAAABPR2NRBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBXHAYDQOJUGQ . You are receiving this because you were mentioned.Message ID: @.***>

yajiviki commented 4 weeks ago

Hi,

I have encountered a recurring issue with the project configuration.

Despite updating Webpack according to the specifications provided in the error message, the issue persists.

Each attempt to resolve the error by following the suggested steps has not led to a permanent solution.

Please find the error screenshot attached.

[image: image.png]

[image: image.png]

[image: image.png] Warm Regards, VIJAY

Vijay Anand Natrajan - Developer of Imaging and Workflow Automation www.bright-river.com @.***

On Fri, 1 Nov 2024 at 07:39, Vijay Anand Natarajan < @.***> wrote:

Simone Gosetto, Sure I'll check and let you know

Warm Regards, VIJAY


Vijay Anand Natrajan - Developer of Imaging and Workflow Automation www.bright-river.com @.***

On Wed, 30 Oct 2024 at 22:27, Simone Gosetto @.***> wrote:

@yajiviki https://github.com/yajiviki can you try to install "npm install @.***" and give me feedback? is it's ok i can release the v1.3.9

— Reply to this email directly, view it on GitHub https://github.com/simonegosetto/pdf-parse-new/issues/5#issuecomment-2447808944, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOUSCUC7LECTV7P472IF7TZ6EFZDAVCNFSM6AAAAABPR2NRBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBXHAYDQOJUGQ . You are receiving this because you were mentioned.Message ID: @.***>

simonegosetto commented 3 weeks ago

@yajiviki i can't see the attachments

yajiviki commented 3 weeks ago

Sorry, It was in the screenshot. Warm Regards, VIJAY

Vijay Anand Natrajan - Developer of Imaging and Workflow Automation www.bright-river.com @.***

On Fri, 1 Nov 2024 at 20:39, Simone Gosetto @.***> wrote:

@yajiviki https://github.com/yajiviki i can't see the attachments

— Reply to this email directly, view it on GitHub https://github.com/simonegosetto/pdf-parse-new/issues/5#issuecomment-2452037528, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFOUSCWWV4AASU2QCXOKXLTZ6OKSZAVCNFSM6AAAAABPR2NRBCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJSGAZTONJSHA . You are receiving this because you were mentioned.Message ID: @.***>