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

params.get is not a function #262

Closed
mathias22osterhagen22 opened this issue Jan 24, 2022 · 0 comments
Closed

params.get is not a function #262

mathias22osterhagen22 opened this issue Jan 24, 2022 · 0 comments

Comments

@mathias22osterhagen22
Copy link

mathias22osterhagen22 commented Jan 24, 2022

I'm getting this error when I want to load this PDF: https://gd.lu/rcsl/4hXzVq

{
  message: 'params.get is not a function',
  stack: 'TypeError: params.get is not a function\n' +
    '    at new CCITTFaxStream (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:26397:28)\n' +
    '    at Parser_makeFilter [as makeFilter] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:24310:16)\n' +    '    at Parser_filter [as filter] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:24268:25)\n' +        
    '    at Parser_makeStream [as makeStream] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:24248:21)\n' +    '    at Parser_getObj [as getObj] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:24084:18)\n' +        
    '    at XRef_fetch [as fetch] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:5758:22)\n' +
    '    at XRef_fetch [as fetch] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:5755:25)\n' +
    '    at XRef_fetchIfRef [as fetchIfRef] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:5704:19)\n' +   
    '    at Dict_get [as get] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:4763:28)\n' +
    '    at Dict_getAll [as getAll] (eval at <anonymous> (project_folder\\node_modules\\pdf2json\\lib\\pdf.js:62:1), <anonymous>:4814:24)'
}
Error: Page 2: params.get is not a function
Error: Page 2: params.get is not a function

Seems that I can't try catch it :/

Edit: I bypassed it by adding:

    if (params.get == null)
      params = new Dict();

Here: https://github.com/modesty/pdf2json/blob/master/base/core/stream.js#L1650

But I don't know if it's a good fix or no.

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

1 participant