{"record":{"id":"0e670355919849dc","repo":"mozilla/pdf.js","slug":"invalid-number-string-fromcharcode-ch-charco","errorCode":null,"errorMessage":"Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})","messagePattern":"Invalid number: (.+?) \\(charCode (.+?)\\)","errorType":"exception","errorClass":"FormatError","httpStatus":null,"severity":"error","filePath":"src/core/parser.js","lineNumber":1035,"sourceCode":"    if (ch === /* '.' = */ 0x2e) {\n      divideBy = 10;\n      ch = this.nextChar();\n    }\n    if (ch < /* '0' = */ 0x30 || ch > /* '9' = */ 0x39) {\n      const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`;\n\n      if (\n        isWhiteSpace(ch) ||\n        /* '(' = */ ch === 0x28 ||\n        /* '<' = */ ch === 0x3c ||\n        ch === /* EOF = */ -1\n      ) {\n        // This is consistent with Adobe Reader (fixes issue9252.pdf,\n        // issue15604.pdf, bug1753983.pdf, bug1953099.pdf).\n        info(`Lexer.getNumber - \"${msg}\".`);\n        return 0;\n      }\n      throw new FormatError(msg);\n    }\n\n    let baseValue = ch - 0x30; // '0'\n\n    while ((ch = this.nextChar()) >= 0) {\n      if (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) {\n        const currentDigit = ch - 0x30; // '0'\n        if (divideBy !== 0) {\n          // We are after a point.\n          divideBy *= 10;\n        }\n        baseValue = baseValue * 10 + currentDigit;\n      } else if (ch === /* '.' = */ 0x2e) {\n        if (divideBy === 0) {\n          divideBy = 1;\n        } else {\n          // A number can have only one dot.\n          break;","sourceCodeStart":1017,"sourceCodeEnd":1053,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/core/parser.js#L1017-L1053","documentation":"Error \"Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})\" thrown in mozilla/pdf.js.","triggerScenarios":"Thrown at src/core/parser.js:1035 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the malformed number token in the content stream or PDF object; numbers must contain only digits, an optional sign, and at most one decimal point.","Regenerate the PDF with a conforming writer if the number was produced by a broken generator."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}