Uncategorized admin on 18 Oct 2004 10:53 pm
Busy, busy, busy…
Well. The last month at work was entertaining. Sometimes it was entertaining past midnight. And 3 a.m. And 6 a.m.
Most — nay, ALL — of the “fun” involved PDFs. And cursing Adobe’s name. PDFs are fine in small numbers but if you’re dealing with thousands of them, in 6 languages, sometimes things can get dicey. For instance: the spiffy PDF normalizer didn’t deal with the Chinese and Korean fonts very well, requiring a workaround (still automated but very slow).
Then there was the whole “page resizing” debacle.
Some wise-guy sent us PDFs with mixed page sizes, which would be fine if our imposition system wasn’t built for a different, single, page size. And if those thousands of pages didn’t need to print the next day, which they did. Ironically it is trivial to create a scaled PDF from Acrobat because there’s a button right there in the print dialog box to “shrink to fit” — but making it work for a few hundred PDFs via batch processing and Javascript is a lot like bashing your head against a wall. Repeatedly. After a couple of hours of that I decided that I would tough it out and just use a macro to process the PDFs (control-P, hit return, wait, close, control-P, hit return, wait, close… etc.) through the Adobe PDF print driver.
So, that was fine. It was late, but fine. Wouldn’t have to do that again for a while and by then I could work out the bugs in the Javascript or do it some other way (for there are many). Then, a couple of days later: “Oh, by the way, we’re printing the foreign languages for the first time ever!” Joy. The files started coming in after 5 p.m. and there were almost 4 times as many. It sucked, it sucked bad, but by 6 a.m. everything was basically done (there are many other steps after what I’m mentioning here, BTW.) I was able to get upwards of 4 hours of sleep before my pager woke me up (here’s the debacle part) — a couple dozen of the files had some blank pages. This is not something you want to discover after you’ve printed, say, a thousand copies. Or many thousands. That sort of thing costs actual money.
My best guess is that if you’re force feeding Chinese and Korean PDFs through the Adobe PDF print driver with a macro (i.e. as fast as the buttons can be pressed) you’re going to end up with some failures to embed fonts (or something) and you might have the occasional blank page. Running the offending files manually, one at a time, did not present any problems. (I think it helps a lot to pause the print queue while you’re printing from Acrobat, then resume and let it process the PDFs.)
Last week, since I was no longer “under the gun,” I was finally able to spend some time working on a much better PDF scaling solution (of which there are many). The simplest and cheapest method would be to export each page to EPS and put a tiny Postscript wrapper around it (something like: %! EPSF … gsave .76 .76 scale (insert your EPS) grestore), using Perl to read the bounding boxes and figure the appropriate scale. However, since I have some experience with iSED QuickPDF (which will be mentioned in the following rant) I decided to make a spiffy GUI app that does everything I need.
With QuickPDF it’s very easy to slice and dice PDFs without using Acrobat at all. Here’s a simple two-up imposition tutorial. Cranking out shrunken pages is merely a matter of capturing the original pages, inserting new pages, and drawing the original pages at a new size. As far as I can tell there is no way to do that with javascript inside Acrobat.
So now I have a spiffy GUI app that scales pages within a PDF to whatever size I want. Last week I needed to shrink mixed Letter and Legal size pages to 8.25″ x 10.625″. I did a little speed comparison between my macro process and my new application. Old way, 20 PDFs, 252 pages: 4 1/2 minutes. New way: 4 seconds. The new app is up to 65 times faster than the (painful) print to PDF method from Acrobat. It can process those 20 PDFs faster than they open in Acrobat (select 20 files, hit enter, wait for them to load). And I can just point it at a folder full of PDFs and ignore it for a few minutes while it cranks through them. More importantly, I could give that app to a trained monkey and I wouldn’t have to touch the files at all.
Now that I have this program, a week after I really needed it, I will probably not need it for another year, when this particular project rolls around again. This project involves 10-11 months of absolutely nothing, and then one or two months of chaos, (because we have limited control over the files given to us, which have new and interesting problems every year). It’s a scene, man.