简体   繁体   English

Adobe Acrobat Reader 无法打开 pdf 文件,因为它不是受支持的文件类型或文件已损坏

[英]Adobe Acrobat Reader could not open pdf file because it is either not a supported file type or because the file has been damaged

I am using below code while merging single PDF file.我在合并单个 PDF 文件时使用下面的代码。

link: https://codesjava.com/itext-merge-pdf-files-in-java链接: https://codesjava.com/itext-merge-pdf-files-in-java

Some times only, I am facing below issue, How can i resolve please help me, I should be use live.仅在某些时候,我面临以下问题,我该如何解决,请帮助我,我应该实时使用。 itextpdf.5.4.4 version itextpdf.5.4.4版本

Adobe Acrobat Reader could not open pdf file because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). Adobe Acrobat Reader 无法打开 pdf 文件,因为它不是受支持的文件类型或文件已损坏(例如,它作为 email 附件发送且未正确解码)。

You are making the mistake of trying to merge PDF files using the PDFWriter class.您错误地尝试使用 PDFWriter class 合并 PDF 文件。 It is bad code and should not be used according to the creator of the iText library.根据 iText 库的创建者,这是错误代码,不应使用。

See this post how to properly merge PDF files.请参阅这篇文章如何正确合并 PDF 文件。

Merge pdf documents of different width using iText 使用 iText 合并不同宽度的 pdf 文档

You should be using the PDFCOPY class to merge files.您应该使用 PDFCOPY class 来合并文件。

Also, you cannot merge a 'single' PDF file like your first sentence states.此外,您不能像第一句话所述合并“单个” PDF 文件。 The idea of merging is to combine multiple pages or files.合并的想法是合并多个页面或文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM