|
|
#1 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Tiff to PDF Revisited (Ghostscript vs. jpgtoPdf)
I need advice on the *best* way to convert TIFF files to PDF files on Mac OSX. ImageMagick, which I've been trying to use (see here ), just doesn't cut it. It can't handle a large number of Tiff files, even if they are small and compressed. It crashes my computer. However, I see that there are dozens of other programs out there that I might use, but it is overwhelming. Here is a list of links on the subject I have made:
http://kerim.oxus.net/bookmarks/view_group.php?id=99 As you can see, there seem to be dozens of options. Right now I am thinking of using ImageMagick to first convert my scans to PostScript or EPS and then converting those to PDF useing Ghostscript. (1) ANyone have a better idea? (For instance, using jpgtoPDF?) (2) What would the command to do this be? Oh, and I'd like to stick to programs I can install with FINK. Thanks! |
|
|
|
|
|
#2 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
I'm having problems testing out ghostscript.
(1) I can't figure out how to batch convert mulitple files to a single PDF. ps2pdf *.ps does NOT work!!! (2) I can't figure out how to force it to print in landscape mode. There is no landscape paper size, and using the -g variable does not seem to get me anywhere (setting the "geometry"). Maybe I don't have the correct settings? If I could do both of these then I should be able to at least see how GostScript compares to ImageMagick. |
|
|
|
|
|
#3 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
I'm beginning to lose hope. There seem to be some utilities, such as "mpage" and "psmerge" which can merge multiple ps files into a single one, which I could then convert with ghostscript. However, there does not seem to be a FINK installer for either or any of these programs. FINK does have something called "PSutils" which includes a "PSMERGE" command, but I can't get that to work properly either. The Man isn't very helpful and suggests that the command may not work for most uses ... it doesn't give an error, just a useless 8K file...
|
|
|
|
|
|
#4 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Interestingly, in 10.2.2, while they have fixed the ability of Preview ot print TIFF files. It seems to only print the first page of multipage TIFF files. The trick of creating a multipage TIFF by draging multiple TIFF files on the PReview.app icon works, but then you can only save the first page... very strange.
|
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: May 2002
Location: Sweden
Posts: 282
|
Kerim. You get little help with this TIFF to PDF thingy I see. It seems to be two problems; 1) converting TIFF to PDF, 2) merging several PS (TIFF?) files into one single for PDF-conversion?
Have you found a way to do the TIFF to PDF conversion? Since you talked about dragging TIFF files to Preview.app I tried with TextEdit.app (that is, I dragged the files to an open TextEdit document window). It seems to work, though I'm not sure the quality of the images will do for your purposes. If it is then this solves both the problems. Also I think that it might be easier to find a utility that merges several PDF files rather than ps files. One such "utility" is Adobe's own Acrobat program. But I would be surprised if there's not an open source alternative around. I'll keep my eyes open for this. Regards,
__________________
/PEZ |
|
|
|
|
|
#6 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Well, I can convert TIFF to pdf directly with ImageMagick, GraphicConverter, Omnipage Pro, preview, but there are problems with all of these methods. If you see the linked thread at the top I am trying to find something that will automate the process on large batch jobs. Most of these programs fail for one reason or another. Mostly of the drag-and-drop programs can't handle properly maintaining the page order of imported files even if they are numbered sequetially!!! And some of the programs produce corrupted output, while others simply crash because of memory problems. So the problem is finding something reliable.
It seems that if I go from Multipage PS files to PDF I could use GhostScript to produce the PDF, but that still requires creating a multipage PS file, and I don't see a standalone utility for that. I could also possibly try another route: convert all the pictures to JPGs and then use jpg2pdf. I haven't tried this yet because this is a shareware utility and I'm also worried about what settings I would need on the JPG files ot make them print as nicely as TIFF or PS files. I'm sur e this is possible, but I'll have to keep at it. IF you learn anything let me know! |
|
|
|
|
|
#7 |
|
Major Leaguer
Join Date: May 2002
Location: Sweden
Posts: 282
|
Creating the multipage PS file could be tricky.. But it might work to create multiple PDF files and convert them with pdf2ps and then ps-merge those PS files. Tried that?
__________________
/PEZ |
|
|
|
|
|
#8 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Now there is a sick but possibly brilliant idea.
Right now I'm trying jpg2pdf. IT is $65 shareware, so if your method works it could save me some $$$. I'll report back on both methods... |
|
|
|
|
|
#9 | |||||||||||||||||||
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Well, jpg2pdf gave me this:
So it isn't really shareware - you can't even try it. Moreover, you need the pro version to do greyscale jpgs... |
|||||||||||||||||||
|
|
|
|
|
#10 | |||||||||||||||||||
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Wait, I read this again - this is what I was trying to do. Do you know how to merge PS files? This is what I needed to know. I couldn'g figure it out. If I can do that then Ghostscript can turn it into a pdf. You see, I don't even need to do pdf2ps because Imagemagick can output in PS, so I already have multiple PS files - I just can't find any way to merge them from the command line! |
|||||||||||||||||||
|
|
|
|
|
#11 |
|
Major Leaguer
Join Date: May 2002
Location: Sweden
Posts: 282
|
The ides with pdf2ps would be to satisfy psmerge's requirement that those PS files should come from the same source. But you're correct that it's a bit icky. However, I might have found a less icky solution for you. Running "fink list" I saw the "libtiff" package and installed it. It comes with a utility that's named tiff2ps, how about that?
I used it like this:Code:
$ tiff2ps *.tiff > tiffs.ps $ ps2pdf tiffs.ps
__________________
/PEZ |
|
|
|
|
|
#12 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Turns out I already had that installed! Didn't even know it. Boy is it fast! And this seems to be *the* solution - except for a small glitch that can probably be fixed.
The problem I have is that the resulting PDF file was all screwed up. Each page was only showing a portion of the original page. I need to learn how to set ps2pdf to properly align the image in landscape and also to keep the resolution smaller so that the whole TIFF appears on the page. Thanks a lot - I was about to give up but this gives me renewed hope! |
|
|
|
|
|
#13 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
This seems to work! And it is like a zillion times faster than using ImageMagick.
Code:
tiff2ps -h 8.5 -w 11 *.tiff > tiffs.ps ps2pdfwr -g7920x6120 tiffs.ps Thanks for your help - this really saves me! |
|
|
|
|
|
#14 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
See here for the new script. Seems to be working OK, although I still need to do some tests to make sure that it is working all the time. I had some errors that may just be from corrupted files. Still, the script should be helpful to anyone who is trying to do such conversions, and the commands in this thread should be enough for anyone who just wants to go from TIF to PDF (without doing any batch filtering, cropping, etc.)
|
|
|
|
|
|
#15 |
|
Major Leaguer
Join Date: May 2002
Location: Sweden
Posts: 282
|
Another way, which may or may not work, could be to use imagemagick to merge the PS files. Like:
% bash $ for f in *.tiff; do convert [options] $f $f.ps; done $ convert *.ps merged.ps $ ps2pdf merged.pdf The last two steps could be combined: $ convert *.ps ps:- | ps2pdf - merged.pdf I'm new to imagemagick as of today so I can't be trusted with advice on it really.
__________________
/PEZ |
|
|
|
|
|
#16 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
Yes, I could use ImageMagick, but the reason I set up this thread is that ImagMagick does not do well with processor use or memory use in OS X. At least not the FINK install of ImageMagick. It is ok when doing one file a time, but when doing a merge it screws up. I see that you have found a way of doing it that doesn't use the imagemagick "-adjoin" command, so it might work better, but I'm quite happy with the alternative method as it seems to be so much faster and less processor intensive than ImageMagick. It is like night and day.
|
|
|
|
|
|
#17 |
|
Major Leaguer
Join Date: May 2002
Location: Sweden
Posts: 282
|
The -adjoin option is default so it's still involved. But it could be that the memory leaks you experience when merging TIFF files is not present when merging PS files, so it could work.
__________________
/PEZ |
|
|
|
|
|
#18 |
|
Major Leaguer
Join Date: Jan 2002
Posts: 311
|
What I've done in my script is to force imagemagick to convert the files one file at a time. It seems to work better this way. Maybe when FINK upgrades to ImageMagick 5.5.x I'll try again!
|
|
|
|
![]() |
|
|