dunso / pdf-parser

Convert PDF content and layout information with pdf.js
Apache License 2.0
21 stars 7 forks source link

pdf2json Warning: TT: undefined funciton: 32 #4

Open cppljevans opened 5 years ago

cppljevans commented 5 years ago

On my system:

Linux lje-DL 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

when the pdf2html.js is run, the 1st line shows a warning:

evansl@lje-DL:~/prog_dev/pdf/npm/pdf-parser/pdf-parser/example/node$ node pdf2json.js|head -1 Warning: TT: undefined function: 32

I tried to use node inspect ...; however, that was mostly useless because I kept having to press s or n and I could not make sense of what was happening.

Please provide some guidance about how to debug the problem of a solution to the problem.

TIA.

-regards, Larry

dunso commented 5 years ago

The warning is generated by pdf.js. Perhaps you can find answers in pdf.js project.

MI53RE commented 5 years ago

Explaination can be found here : https://github.com/mozilla/pdf.js/issues/3768#issuecomment-36468349 But still the "how to resolve this" is not necessarily clear (make PDF-A ?)

Edit : I found the corresponding line in pdfjs which produce the warning, just posting here if someone can find it helpfull: https://github.com/mozilla/pdf.js/blob/c0d6e46e392b327996eb0964b7932cb5bdde1727/src/core/fonts.js#L2218

fgilio commented 5 years ago

Hello! Just had this same problem. Making it a PDF-A helps, but there's also a probably more accurate way if you can use Acrobat. In the Edit menu go to Preflight and in PDF fixups choose Fix potential font problems. Worked perfectly in my broken PDF.