Ghostscript:如何确定将多页PDF转换为多个TIFF的输出分辨率
我需要从扫描仪中提取一堆多页PDF文件中的TIFF图像. 在扫描过程中,我指定了600dpi的分辨率.
I need to extract TIFF images from a bunch of multi-page PDF files from a scanner. During the scanning I specified a resolution of 600dpi.
-
这是我用来生成TIFF图像的代码:
Here is the code I used to generate TIFF images:
gs -q -dNOPAUSE -sDEVICE=tiffg4 \
-sOutputFile=a_page%02d.tif a.pdf -r600x600 -c quit
这给了我正确数量的TIFF图像,但是,图像尺寸比我预期的要小.
This gave me the correct number of TIFF images, however, the image dimension is smaller than I expected.
无论我如何更改-r
选项,输出图像都具有相同的大小.
No matter how I change the -r
option, the output images have the same size.
这里发生了什么?
输出的TIFF图像具有一定的压缩率,如何更改gs选项,使其不包含任何压缩率?
The output TIFF images have some compression, how should I change the gs option so that they do NOT contain any compression?
http://pages.cs.wisc.edu /~ghost/doc/cvs/Devices.htm#TIFF 有几个选项可供选择,但在我看来,没有人表示"8位黑白" +无压缩".
http://pages.cs.wisc.edu/~ghost/doc/cvs/Devices.htm#TIFF has a few options to select, but seems to me no one means "8-bit Black&White" + "Compression Free".
有人解决这两个问题吗?
Does anybody how to solve these two problems?
如果使用tiffg4
进行输出,则隐式要求在PDF中也获取Fax G4压缩类型.
If you use tiffg4
for output, then you implicitely asked to also get the Fax G4 compression type in the PDF.
您可以通过使用不同的TIFF输出设备(例如tiffgray
(灰色,8位),tiff24nc
(RGB-TIFF,每个颜色通道为8位),tiff32nc
(CMYK),告诉Ghostscript不使用压缩. -TIFF,每个颜色通道8bit),....默认情况下,所有这些输出类型都是未压缩的.
You can tell Ghostscript to use no compression by using a different TIFF output device, such as tiffgray
(gray, 8bit), tiff24nc
(RGB-TIFF, 8bit for each color channel), tiff32nc
(CMYK-TIFF, 8bit for each color channel), .... All these output types are uncompressed by default.
您也可以使用tiffg4
,但是要删除压缩文件:
You can also use tiffg4
but remove the compression:
gs \
-o a_page%02d.tif \
-sDEVICE=tiffg4 \
-r600x600 \
-g4960x7020 \
-sCompression=none \
a.pdf
顺便说一句,没有"8bit Black + White"之类的东西.有"1bit Black + White",但是一旦超出1bit,您将进入灰度级领域...:-)
BTW, there is no such thing as "8bit Black+White". There is "1bit Black+White", but as soon as you go beyond 1bit, you'll enter the realm of grayscales... :-)