如何修复"Compression JPEG仅支持单个条带".问题 [英] How to fix "Compression JPEG is only supported with a single strip" issue
问题描述
我正在一个项目中,必须使用itextsharp
创建PDF文件.但是,出现以下错误:
I'm working on a project in which I have to create a PDF file using itextsharp
. However, I get the following error:
System.IO.IOException: Compression JPEG is only supported with a single strip. This image has 229 strips.
at iTextSharp.text.pdf.codec.TiffImage.GetTiffImageColor(TIFFDirectory dir, RandomAccessFileOrArray s)
at iTextSharp.text.pdf.codec.TiffImage.GetTiffImage(RandomAccessFileOrArray s, Int32 page, Boolean direct)
at iTextSharp.text.Image.GetInstance(Uri url)
at iTextSharp.text.Image.GetInstance(String filename)
at TPDFG.Program.Main(String[] args) in f:\TPDF\TPDF\Program.cs:line 157
和行号我的代码中的157是:
and the line no. 157 in my code is:
Image _Image = Image.GetInstance(di.FullName + "\\" + ImageUrl);
一切正常,仅当嵌入式图像为TIFF并使用JPEG压缩压缩时,我才出现此错误.如果我使用未压缩的TIFF或LZW压缩的TIFF,则一切正常.
Everything works fine, I get this error only when the embedded image is TIFF and is compressed with JPEG Compression. If I use uncompressed TIFF or LZW compressed TIFF, everything works fine.
我不是图像专家,所以我不知道这个错误是什么意思.
I'm no image expert, so I don't know what this error mean.
我正在使用imagemagick
命令行实用程序进行图像处理和转换.
I'm using imagemagick
command line utility for image manipulation and conversion.
推荐答案
我刚刚找到了这篇文章,但它是针对itext
java版本的.它说 iText不支持多条带状纸条.因此,我认为这对于itextsharp也同样适用.
I just found this article but its for itext
java version. It says multi-strip tiffs aren't supported in iText. So I think this holds true for itextsharp as well.
有关更多详细信息:-