在尝试将多页文档从tiff转换为pdf时,我遇到了以下问题:
↪ tiff2pdf 0271.f1.tiff -o 0271.f1.pdf
tiff2pdf: No support for 0271.f1.tiff with no photometric interpretation tag.
tiff2pdf: An error occurred creating output PDF file.有人知道这是什么原因以及如何修复它吗?
发布于 2013-03-12 05:01:25
这是因为多页tiff中的一个或多个页面没有设置photometric interpretation标记。这是一个必需的标签,所以这意味着您的tiffs在技术上是无效的(尽管我打赌它们无论如何都工作得很好)。
要解决此问题,必须标识未设置光度控制解释的页面,并对其进行修复。
要识别页面,您可以简单地运行如下命令:
↪ tiffinfo your-file.tiff这将在您的tiff的每个页面中显示的信息。对于每个好的页面,您将看到类似如下的内容:
TIFF Directory at offset 0x105c0 (67008)
Subfile Type: (0 = 0x0)
Image Width: 1760 Image Length: 2639
Resolution: 300, 300 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
**Photometric Interpretation: min-is-white**
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2639
Planar Configuration: single image plane
Software: ScanFix(TM) Enhanced ImageGear Version: 11.00.024
DateTime: Mon Oct 31 15:11:07 2005
Artist: 1996-2001 AccuSoft Co., All rights reserved如果你有一个糟糕的页面,它将缺少photometric interpretation部分,你可以用以下方法来修复它:
↪ tiffset -d $page-number -s 262 0 your-file.tiff请注意,零值是光度控制解释关键点的默认值,即262。您可以在上面的链接中看到该键的其他值。
如果你的tiff有很多页面(就像我的一样),你可能不能很容易地用眼睛识别出坏的页面。在这种情况下,您可以采用暴力方法,将所有页面的光度解释设置为默认值。
# First, split the tiff into many one-page files
↪ tiffsplit your-file.tiff
# Then, set the photometric interpretation to the default for all pages
↪ find . -name '*.tiff' -exec tiffset -s 262 0 '{}' \;
# Then rejoin the pages
↪ tiffcp *.tiff -o out-file.tiff有很多空洞的工作,但却能完成工作。
https://stackoverflow.com/questions/15348539
复制相似问题