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

ParsingError in Reading Auto-Generated PDF Documents #113

Closed
microshine opened this issue Jan 4, 2024 · 2 comments · Fixed by #114
Closed

ParsingError in Reading Auto-Generated PDF Documents #113

microshine opened this issue Jan 4, 2024 · 2 comments · Fixed by #114
Assignees
Labels
bug Something isn't working

Comments

@microshine
Copy link
Contributor

The error arises in the process of creating a CrossReferenceTable from the PDF stream, specifically related to the handling of end-of-line characters. The error message is as follows:

Error Message:

ParsingError: Cannot create CrossReferenceTable from PDF stream at position 28. Wrong end of line (must be \r\n or \n)
    at CrossReferenceTable.fromPDF (peculiar.pdf.core.es.js:329:1)
    at PDFDocumentUpdate.fromPDF (peculiar.pdf.core.es.js:8951:1)
    at PDFDocumentUpdate.fromPDF (peculiar.pdf.core.es.js:8974:1)
    at PDFDocumentUpdate.fromPDF (peculiar.pdf.core.es.js:8974:1)
    at PDFDocument.fromPDF (peculiar.pdf.core.es.js:9516:1)
    at PDFDocument.fromPDF (peculiar.pdf.core.es.js:9438:1)
    at PDFDocument.load (peculiar.pdf.doc.es.js:6455:1)
    at Module.<anonymous> (verify.ts:502:1)
    at Generator.next (<anonymous>)
    at tslib.es6.js:121:1

Steps to Reproduce:

  1. The issue is observed when attempting to read auto-generated PDF documents, such as in the provided example: Audit for Hello (1).pdf.
  2. The error occurs during the parsing phase.
@microshine microshine added the bug Something isn't working label Jan 4, 2024
@microshine microshine self-assigned this Jan 4, 2024
@microshine
Copy link
Contributor Author

The issue with the provided PDF document is that there's a space character (0x20) among the end-of-line symbols, while the only allowed characters are \n and \r.

I plan to modify the end-of-line check rule to accommodate reading various characters.

@microshine microshine linked a pull request Jan 4, 2024 that will close this issue
@microshine
Copy link
Contributor Author

I've fixed the error related to reading the XRef table in the PDF document and have released a new version, v1.13.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant