modesty / modesty/pdf2json

fontObj is not a fontObj in pdf.js eval

Open
#104 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.2k
Forks
394
Avg merge
3d 5h
Merged PRs (30d)
7

Description

undefined:40950
            fontObj.spaceWidth = (spaceId >= 0 && isArray(fontObj.widths)) ? fontObj.widths[spaceId] : 250;
                               ^

TypeError: Cannot create property 'spaceWidth' on string 'Cannot read property '1' of undefined'
    at CanvasGraphics_setFont [as setFont] (eval at <anonymous> (/node_modules/pdf3json/lib/pdf.js:60:1), <anonymous>:40950:32)
    at CanvasGraphics_executeOperatorList [as executeOperatorList] (eval at <anonymous> (/node_modules/pdf3json/lib/pdf.js:60:1), <anonymous>:40560:27)
    at InternalRenderTask__next [as _next] (eval at <anonymous> (/node_modules/pdf3json/lib/pdf.js:60:1), <anonymous>:43553:39)
    at InternalRenderTask__continue [as _continue] (eval at <anonymous> (/node_modules/pdf3json/lib/pdf.js:60:1), <anonymous>:43545:14)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the reported PDF failure, then inspect /node_modules/pdf3json/lib/pdf.js around CanvasGraphics_setFont and the calls through CanvasGraphics_executeOperatorList. Trace why fontObj contains the reported string and define a regression check for the affected input; the issue does not name a test file or specify further acceptance criteria.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.