I decided to bring the blog out of mothballs in the middle of my exams for a very simple reason: It took me a really bloody long time to find out how to do something which strikes me as a feature which should be simple and intuitive. Onwards with the tail of creating PDFs on Mac:
It all began when a friend, Nilpesh, approached me about making the Word Document of the Diary he has been putting together from our School trip to China and Tibet last summer into a PDF. This has been a labour of love from the beginning and he has put a lot into it, and so when he asked me to help with the last section I was more than happy to. He is using Lulu to professionally print the diary, and they have a comprehensive list of requirements for PDFs if that is the format to be submitted.
With this in mind, I headed to Microsoft Word. Here we encountered the first problem – Word 2008 on the Mac totally ignored almost all of the formatting he had put together in Word 2007 on Windows. Saved in a docx file, one would assume that the two would be totally compatible, but apparently not. Why? Ask Microsoft, but God help us if this is to be the open format of the ages… Some two days later after Pesh had reformatted the entire document and saved in doc format, I fired up Word 2008 again, and to my delight it opened and formatted correctly. Head over to the print dialogue and click “Save as PostScript”. Word churned away, and eventually produced some .ps files. “Some?” we wondered. Why is there more than one .ps file? For some reason I still don’t understand, the export to PostScript function seems to randomly split the file at arbitrary points. As this is a 70-page document, I expect it is some processing issue or the file becoming too large, although each time I made a revision to the document and re-PostScripted, the spilts were in new places so I have no clue.
Now the question was, how to make a single PDF from these numerous .ps files? Distiller happily accepted all of the settings I entered from the Lulu support pages, and also happily churned out separate PDFs for each of the PostScript files, but I could not find an easy way to make a single file. To preserve the specific settings of the PDF I did not want to simply combine them using Acrobat. This would have been nice, but although Acrobat and Distiller are related and can do some of the same things, there seems to be no way to enter the specfic PDF settings into Acrobat in the same way as you can in Distiller.
Much Googling ensued. I found some places which told me how to create a ‘merge.ps’ file which basically contained some Distillerese telling it where to find the separate PostScript files and to process them in turn to create a single PDF. However, it seems that to close a security hole, the functionality which Distiller used to have has been disabled, and so the processing of ‘merge.ps’ promptly failed with a log file cheerily telling me “%%[ Warning: Empty job. No PDF file produced. ] %%”. So I guess that wasn’t going to work then…
A lot more Googling ensued, with me trying various alterations on the commands in the merge file to try to get Distiller to behave, to no avail. One final lucky search of ‘distiller 8 combine ps’ revealed the Holy Grail of PostScript magic I had suspected was lurking out there for the hunter who didn’t do the sensible thing hours before and throw up his hands. Fourth result was a macosxhints.com page. With nothing to lose, I downloaded the script and ran it. First thing it asked for was the location of ‘Distiller 6′. Thinking to myself that this was probably going to fail considering I was trying to use Distiller 8, I pointed it to the app anyway and proceeded. The script asked for the folder containing the PostScripts, which I duly supplied, and to my surprise Distiller sprung to life and began processing the files. A few minutes later, the final PDF was done with all the settings I asked for, and importantly, as a single file. Cue angelic chorus of ‘Hallelulia!’.
All credit to Carlo Notarianni for this script, to whom I owe a lot and who likely saved me many more hours trying to cobble together something to make this work.
