1

I have a large collection of documents in various formats (PDF, TIFF, JPEG).

Many of the TIFFs are multi-page, like faxes, and the only way I know to see all the pages is with Preview.

Is there some method or app or shell command (via brew) which can find all the multi-page TIFFs so that I can convert them to multi-page PDFs?

  • 2
    Are you looking to learn how to program this (so you can decide to hire that work out or do it yourself) or more of a software-recommendation type problem. The programming method is quite broad in itself, and shell / automator / AppleScript might be quite suitable in the hands of someone moderately skilled with those tools. – bmike Aug 11 '16 at 11:19
  • I played around bit with LibTIFF which among the utils are tiff2pdf and tiff2ps. The former didn't work, just made blank pages, however the latter did work. I then used the native pstopdf to convert the .ps files to .pdf files. This can be scripted to deal with multiple input files and removing the intermediary .ps files so what's left are the original .tiff and the converted .pdf files. Your question is somewhat broad so I'm not going to put this in the form of an answer as there is no info about your skill level and what else you need to deal with the issue. – user3439894 Aug 11 '16 at 16:01
  • tiff2pdf works for me ... on about 60% of the TIFFs. The rest I can convert with Preview. My issue is identifying them, not converting them. I'll try exiftool. – Dan Aug 12 '16 at 10:03
1

There is a way to find them using a command line in the terminal. This requires you to install a tool which is not part of the default command set.

Download and install exiftool.

exiftool is able to print detailed information about image files, including TIFFs. It can tell the difference between multi-page documents and between FAXes and photographic TIFFs. For example testphoto.tif is a regular TIFF file and testfax.tif is a multi-page FAX:

MacBook-Air:Downloads jamie$ exiftool -s -Format -Compression -SubfileType *.tif 
======== testfax.tif
Compression                     : T6/Group 4 Fax
SubfileType                     : Single page of multi-page image
======== testphoto.tif
Format                          : image/tiff
Compression                     : LZW
SubfileType                     : Full-resolution Image
    2 image files read

If we can get the filename and the identifying info on one line, then we can use grep to identify the files we want. The -csv option puts the output on one line in comma seperated value format. So, a command like this would do what you want.

MacBook-Air:Downloads jamie$ exiftool -csv  -SubfileType *.tif | grep multi-page
    2 image files read
testfax.tif,Single page of multi-page image

So, we have correctly identified testfax.tif as the only multi-page TIFF in this directory.

  • You may not be able to rely on exiftool. I have lots of multi-page .tiff files that it doesn't detect as being multi-page, including ones that state T6/Group 4 Fax, are multi-page but doesn't show it. So while it's a possible method it may not be reliable depending on other factors. – user3439894 Aug 12 '16 at 1:43
  • I could believe that, depending on how they were created, attributes could vary. Perhaps for the OP, it will be sufficient, or perhaps even better, to detect the "T6/Group 4 Fax" attribute. – Jamie Cox Aug 12 '16 at 2:02
  • How many pages is testfax.tif and does exiftool give you a Page Count for that .tif? – user3439894 Aug 12 '16 at 2:11
  • testfax.tif is three pages. exiftool -a actually returns info for each separate page: MacBook-Air:Downloads jamie$ exiftool -a testfax.tif | grep -i page Subfile Type : Single page of multi-page image Page Number : 0 3 Subfile Type : Single page of multi-page image Page Number : 1 3 Subfile Type : Single page of multi-page image Page Number : 2 3 So, I'm interpreting that as describing the last page, for example as 2 of 3. – Jamie Cox Aug 12 '16 at 12:01
  • Not working for me ... fails to identify some multipages... :( – Dan Aug 12 '16 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .