gpt4 book ai didi

java - com.itextpdf.text.exceptions.InvalidPdfException : Rebuild failed: Error reading string at file pointer

转载 作者:行者123 更新时间:2023-12-01 14:09:33 26 4
gpt4 key购买 nike

阅读 PDF 时获得以下异常。它在 Acrobat 阅读器中打开得很好。我在另一个问题中读到,虽然它在 acrobat 中打开,但没有必要通过 iText 打开,因为 PDF 包含错误,他建议修复 PDF。但是该文件来自客户端并且他们能够打开 Acrobat,所以要么我必须修复它,要么在 Acrobat 中显示错误或警告。

com.itextpdf.text.exceptions.InvalidPdfException: Rebuild failed: Error reading string at file pointer 10891; Original message: Error reading string at file pointer 10891
at com.itextpdf.text.pdf.PdfReader.readPdf(PdfReader.java:655)

PDF文件摘录
%PDF-1.1
1 0 obj
<<
/Creator (Developer 2000)
/CreatorDate (
/Author (Oracle Reports)
/Producer (Oracle PDF driver)
/Title (con5010I412014141258.pdf)
>>
endobj
3 0 obj
<<
/Type /Pages
/Kids 4 0 R
/Count 5 0 R
>>
endobj
7 0 obj
<</Length 8 0 R>>
stream
BT
  • 有什么方法可以向客户表明 PDF 有错误?通过 Acrobat 或其他一些软件而不是 Java 异常(exception)。
  • 有没有办法绕过这个错误并继续?我们遇到了类似的安全 PDF 问题,我们确实解锁了。请建议
  • 最佳答案

    它实际上是一个无效的 PDF。当我在文本编辑器中打开 PDF 时,我注意到标题的 CreatorDate 没有右括号。我刚刚添加了有效日期的右括号,例如 CreatorDate (05 November 2014 17:50:24) 然后它起作用了。我要求客户纠正他们的立场

    关于java - com.itextpdf.text.exceptions.InvalidPdfException : Rebuild failed: Error reading string at file pointer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28358916/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com