【问题标题】:ItextSharp and CCITTFaxDecodeItextSharp 和 CCITTFaxDecode
【发布时间】:2010-07-09 14:43:59
【问题描述】:

我目前正在尝试使用 iTextSharp 从 pdf 文件中提取图像。

pdf 是由扫描仪制作的:它只有一个页面,其中包含一个大图像。

查看文件时,我发现以下内容:

<< /Type /XObject /Subtype /Image /Name /Obj3 /Width 2480 /Height 3507 /ColorSpace /DeviceGray /BlackIs1  true /BitsPerComponent 1 /Length 5 0 R /Filter /CCITTFaxDecode /DecodeParms << /K -1 /Columns 2480 >> >> stream

我可以使用 iTextSharp 访问它,并尝试使用以下代码保存它:

Dim aFromImageStream = New MemoryStream()
aFromImageStream.Write(bytes, 0, bytes.Length)
Dim anImage = System.Drawing.Bitmap.FromStream(aFromImageStream, True, True)
anImage.Save("c:\test.tiff", System.Drawing.Imaging.ImageFormat.Tiff)

但是,这不起作用,因为我得到一个顶部有不同灰度的黑色 tiff 大文件。

有谁知道如何解码那些 CCITTFaxDecode 图像?

【问题讨论】:

    标签: vb.net pdf itextsharp


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多