Skip to content
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

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

Open
yajiviki opened this issue Oct 8, 2024 · 8 comments
Open

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

yajiviki opened this issue Oct 8, 2024 · 8 comments
Assignees

Comments

@yajiviki
Copy link

yajiviki commented Oct 8, 2024

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 simonegosetto self-assigned this Oct 8, 2024
@simonegosetto
Copy link
Owner

@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

simonegosetto added a commit that referenced this issue Oct 30, 2024
simonegosetto added a commit that referenced this issue Oct 30, 2024
@yajiviki
Copy link
Author

yajiviki commented Nov 1, 2024 via email

@yajiviki
Copy link
Author

yajiviki commented Nov 1, 2024 via email

@simonegosetto
Copy link
Owner

@yajiviki i can't see the attachments

@yajiviki
Copy link
Author

yajiviki commented Nov 1, 2024 via email

@simonegosetto
Copy link
Owner

Sorry, but i don't see the screenshots

@yajiviki
Copy link
Author

yajiviki commented Jan 3, 2025 via email

@simonegosetto
Copy link
Owner

@yajiviki can you try with the version 1.3.9?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants