Command 6: because expected 2 args, but received 0 args; skipping & Unhandled rejection: Error: Illegal character: 41

Open
#141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, node.js
Domain
backend

Research direction

Start with the parser stack in node_modules/pdf2json/lib/pdf.js and the reported input PDF path. Reproduce the failure with the confidential PDF, if it can be provided, and trace the illegal-character error and command warnings during page parsing. Done means the PDF parses without the reported rejection and command-argument warnings.

Written by the indexing model from the issue text.

Description

Hi,

I was using this lib for last few months, but 2 days back i am unable to parse the pdfs. after enabling the logs i see following errors.

Since test file is confidential I cannot publish it here. I can provide the same via email on request.

Can you please help.?

Info: about to load PDF file .\inputs\PREF_0001_26-5000.pdf
Info: Load PDF file status:Success!
Warning: Setting up fake worker.
Info: PDF loaded. pagesCount = 1
Info: start to parse page:1
Info: Command 6: because expected 2 args, but received 0 args; skipping
Warning: Unknown command "X"
Warning: Unknown command "]"
Info: Command 24: expected 0 args, but received 1 args
Warning: Unknown command "V6&="
Warning: Unknown command ">"
Info: Command 4: because expected 1 args, but received 0 args; skipping
Info: Command 15: because expected 6 args, but received 0 args; skipping
Info: Command 5: because expected 1 args, but received 0 args; skipping
Warning: Unknown command "p`"
Info: Command 13: because expected 2 args, but received 0 args; skipping
Info: Command 14: because expected 2 args, but received 0 args; skipping
Warning: Unknown command "]"
Warning: Unhandled rejection: Error: Illegal character: 41
Error: Illegal character: 41
at error (eval at (D:\working\folder\pdfcompare\trunk\node_modules\pdf2json\lib\pdf.js:64:6), :195:9)
at Object.Lexer_getObj [as getObj] (eval at (D:\working\folder\pdfcompare\trunk\node_modules\pdf2js
on\lib\pdf.js:64:6), :24616:11)
at Object.Parser_shift [as shift] (eval at (D:\working\folder\pdfcompare\trunk\node_modules\pdf2jso
n\lib\pdf.js:64:6), :24038:32)
at Object.Parser_getObj [as getObj] (eval at (D:\working\folder\pdfcompare\trunk\node_modules\pdf2j
son\lib\pdf.js:64:6), :24105:12)
at Object.PartialEvaluator_getOperatorList [as getOperatorList] (eval at (D:\working\folder\pdfcomp
are\trunk\node_modules\pdf2json\lib\pdf.js:64:6), :7368:26)
at Object.eval [as onResolve] (eval at (D:\working\folder\pdfcompare\trunk\node_modules\pdf2json\li
b\pdf.js:64:6), :4348:26)
at Object.runHandlers (eval at (D:\working\folder\pdfcompare\trunk\node_modules\pdf2json\lib\pdf.js
:64:6), :864:35)
at ontimeout (timers.js:386:11)
at tryOnTimeout (timers.js:250:5)
at Timer.listOnTimeout (timers.js:214:5)

Dominant language
Java
Stars
2.2k
Forks
396
Avg merge
9d 19h
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modesty/pdf2json

All issues in modesty/pdf2json

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.