TweetFollow Us on Twitter

Spring 91 - PRINT HINTS FROM LUKE & ZZ

PRINT HINTS FROM LUKE & ZZ

COLOR PRINTING WITH LASERWRITER 6.0 REVISITED

PETE "LUKE" ALEXANDER and Zz

[IMAGE Luke+Zz.gif]

Luke speaks

With the release of 32-Bit QuickDraw version 1.0, Apple wanted to find a way to support color printing on the high-end (albeit black-and-white) LaserWriter® II, as well as other, third-party devices. So, the great implementors (GIs) created a new LaserWriter driver--version 6.0. This driver added a new Color/Grayscale button to the print dialog, allowing users to print their "way cool" color pictures that were created with 32-Bit QuickDraw. All was happy in the land of Apple's new color model. But wait! There was a problem lurking on the horizon, a problem called the PostScript Offending Command Error.

Imagine this scenario: You've just created a cool 32-Bit QuickDraw picture, a true masterpiece, and all seems to be going well. You decide to print your picture and show it off to Mom. You choose Print from the File menu; the print dialog appears, and you click OK. A few minutes pass, and voilà: a printed page containing your picture. Life is gooood.

With this success, you're now dreaming of other pictures that you'll be able to create and print. You create another cool 32-bit picture. You choose Print from the File menu; the print dialog appears, and you click OK. A few minutes pass, and this time the PostScript Offending Command Error dialog appears, looking something like this:

Error: LimitCheck; Offending Command: 080AGOBBLEDEGOOK0B

What's this? An offending command? But all you wanted to do was print your color picture. You were able to print your first picture a few minutes ago. What's going on? Unfortunately, LaserWriter driver version 6.0 does not reliably print images that are deeper than 8 bits. We won't bore you with the details: just think of the LaserWriter driver as a shark, ready to swallow a surfer off the California coast. But instead of the surfer dude it was expecting, in rushes the surfer dude's surfboard. The LaserWriter driver chokes on deeper images just as our poor shark chokes on the surfboard; the driver is ready to receive a particular variable but occasionally receives something different, and doesn't know what to do with it. The result: the PostScript Offending Command Error. Life is no longer so good; your dreams are beginning to fade away. But I can see a solution appearing on the horizon . . .

Actually, there are three possible solutions: you can use LaserWriter driver version 6.1 (or version 7.0 when it's available); you can depth-convert your image from 32 bits to 8 bits using 32-Bit QuickDraw; or you can use the PostScript ® image operator to generate PostScript code for your image, and send it directly down to the LaserWriter. Let's look at each solution.

Using LaserWriter driver version 6.1 is the simplest solution. LaserWriter driver version 6.1 likes data of any depth, no matter when it's sent. So, if you're printing to LaserWriter driver version 6.1, life is happy when you're printing your 32-bit images--but how can you be sure that you're using LaserWriter driver version 6.1?You can call PrDrvrVers, which is provided by the Printing Manager to enable your application to determine which version of a particular printer driver you're talking to. But there's a minor problem with this call. You don't know if you're talking to a PostScript LaserWriter or some other device. So, you must dive into the bowels of the print record for additional information. You need to check the high byte of the wDev field of the TPrStl record to determine a particular driver and version. But wait! You thought checking wDev was evil. In this case, using wDev is OK because you're not checking for particular functionality of a driver, and thereby not making your code device dependent. If wDev is 3, you know that you're talking to a PostScript LaserWriter. Non-PostScript LaserWriters (for example, the LaserWriter IIsc) have a different value for the wDev field. You would then call PrDrvrVers to determine if you're talking to LaserWriter driver version 6.1. If PrDrvrVers returns 61, you know that you're using LaserWriter driver version 6.1, and life is good again. If wDev is 3, and the driver version is less than 61, you're not using LaserWriter driver version 6.1, so you have a little more work to do: try the next solution.

The next possible solution is to use 32-Bit QuickDraw to depth-convert your 32-bit image to 8 bits by using 32-Bit QuickDraw's GWorld support. You would first create an 8-bit GWorld containing a grayscale CLUT, and use CopyBits to copy your 32-bit image into it. You would then use CopyBits to copy the 8-bit image directly into the printer's grafPort, and voilà--your image would be printing. This approach works with LaserWriter driver version 6.0 and later.

Your final option is to use the PostScript image operator to generate PostScript code that represents your 32-bit image. This approach is a little more complex than the 32-Bit QuickDraw idea. To send your data down to the LaserWriter, you would need to use the PostScriptHandle PicComments with the image operator. If you're already sending PostScript code to the LaserWriter, this is probably the best approach.

By the way, if you don't have a copy of LaserWriter driver version 6.1, it's available on theDeveloper Essentials disc. If you want to ship this version of the driver with your application, you should contact Apple Software Licensing for the details.

In conclusion, we have some good news and some bad news. The good news is that we've fixed the 32-bit image printing problem that was present in LaserWriter driver versions 6.0, 6.0.1, and 6.0.2. LaserWriter driver version 6.1 will allow you to print pictures that are 1 bit to 32 bits deep without any problems. The bad news is that if you want your application to print all depths of pictures with LaserWriter driver version 6.0, you're going to need to do a little extra work, either depth- converting your pictures from 32 bits to 8 bits before print time, or using the PostScript image operator to generate PostScript code for your image. Now that's not so bad, is it?



PETE "LUKE" ALEXANDER spends much of his Developer Technical Support time diving deep into the bowels of the Printing Manager, where he never turns up his nose at a challenge or at odiferous code that needs explaining. Although that kind of diving is fun, he prefers the balmy blue waters of anyplace (preferably far from computers) that has both beach and beer close together. If he can't get away from it all on the beach somewhere, he'll settle for getting above it all in his glider; with Luke, being up in the air about something takes on a whole new meaning. Fortunately, not everything on the horizon is blue sky. Luke's looking forward to the cool new printing architecture that will make his job (and yours) a lot easier. He's preparing for this new architecture by spending a week sailing around the Caribbean--figuring that he'd better start getting used to a life of leisure. Until that leisure can become a lifestyle, you can count on seeing lots from Luke. *

For details regarding the use of the PostScriptHandle PicComments, take a look at Technical Note #91, Optimizing for the LaserWriter--PicComments. *

For details about depth-converting your 32-bit images or using the PostScript image operator, see Technical Note #72, Color Printing. *

 
AAPL
$112.77
Apple Inc.
+0.99
MSFT
$47.80
Microsoft Corpora
+0.14
GOOG
$522.26
Google Inc.
+5.91

MacTech Search:
Community Search:

Software Updates via MacUpdate

NeoOffice 2014.6 - Mac-tailored, OpenOff...
NeoOffice is a complete office suite for OS X. With NeoOffice, users can view, edit, and save OpenOffice documents, PDF files, and most Microsoft Word, Excel, and PowerPoint documents. NeoOffice 3.x... Read more
LibreOffice 4.3.5.2 - Free Open Source o...
LibreOffice is an office suite (word processor, spreadsheet, presentations, drawing tool) compatible with other major office suites. The Document Foundation is coordinating development and... Read more
CleanApp 5.0.0 Beta 5 - Application dein...
CleanApp is an application deinstaller and archiver.... Your hard drive gets fuller day by day, but do you know why? CleanApp 5 provides you with insights how to reclaim disk space. There are... Read more
Monolingual 1.6.2 - Remove unwanted OS X...
Monolingual is a program for removing unnecesary language resources from OS X, in order to reclaim several hundred megabytes of disk space. It requires a 64-bit capable Intel-based Mac and at least... Read more
NetShade 6.1 - Browse privately using an...
NetShade is an Internet security tool that conceals your IP address on the web. NetShade routes your Web connection through either a public anonymous proxy server, or one of NetShade's own dedicated... Read more
calibre 2.13 - Complete e-library manage...
Calibre is a complete e-book library manager. Organize your collection, convert your books to multiple formats, and sync with all of your devices. Let Calibre be your multi-tasking digital librarian... Read more
Mellel 3.3.7 - Powerful word processor w...
Mellel is the leading word processor for OS X and has been widely considered the industry standard since its inception. Mellel focuses on writers and scholars for technical writing and multilingual... Read more
ScreenFlow 5.0.1 - Create screen recordi...
Save 10% with the exclusive MacUpdate coupon code: AFMacUpdate10 Buy now! ScreenFlow is powerful, easy-to-use screencasting software for the Mac. With ScreenFlow you can record the contents of your... Read more
Simon 4.0 - Monitor changes and crashes...
Simon monitors websites and alerts you of crashes and changes. Select pages to monitor, choose your alert options, and customize your settings. Simon does the rest. Keep a watchful eye on your... Read more
BBEdit 11.0.2 - Powerful text and HTML e...
BBEdit is the leading professional HTML and text editor for the Mac. Specifically crafted in response to the needs of Web authors and software developers, this award-winning product provides a... Read more

Latest Forum Discussions

See All

Living Room 3D for IKEA Makes All In-App...
Living Room 3D for IKEA Makes All In-App Purchases Free Until 2015 Posted by Jessica Fisher on December 22nd, 2014 [ permalink ] | Read more »
Crossbow Warrior – The Legend of William...
Crossbow Warrior – The Legend of William Tell Review By Lee Hamlet on December 22nd, 2014 Our Rating: :: MISSES THE MARKUniversal App - Designed for iPhone and iPad Crossbow Warrior details the entertaining adventures of legendary... | Read more »
Workflow: Powerful Automation Made Simpl...
Workflow: Powerful Automation Made Simple Review By Campbell Bird on December 22nd, 2014 Our Rating: :: GO WITH THE FLOWUniversal App - Designed for iPhone and iPad This powerful app lets users accomplish multiple tasks at touch of... | Read more »
My Little Monster Review
My Little Monster Review By Jordan Minor on December 22nd, 2014 Our Rating: :: IT'S ALIVE!Universal App - Designed for iPhone and iPad What’s it worth to make your own monster?   | Read more »
Galaxy Trucker Pocket (Games)
Galaxy Trucker Pocket 1.0.8 Device: iOS iPhone Category: Games Price: $2.99, Version: 1.0.8 (iTunes) Description: Galaxy Truckers Wanted!================================================================= (5/5) "Galaxy Trucker isn’t... | Read more »
Make your own Tribez Figures (and More)...
Make your own Tribez Figures (and More) with Toyze Posted by Jessica Fisher on December 19th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
So Many Holiday iOS Sales Oh My Goodness...
The holiday season is in full-swing, which means a whole lot of iOS apps and games are going on sale. A bunch already have, in fact. Naturally this means we’re putting together a hand-picked list of the best discounts and sales we can find in order... | Read more »
It’s Bird vs. Bird in the New PvP Mode f...
It’s Bird vs. Bird in the New PvP Mode for Angry Birds Epic Posted by Jessica Fisher on December 19th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Telltale Games and Mojang Announce Minec...
Telltale Games and Mojang Announce Minecraft: Story Mode – A Telltale Games Series Posted by Jessica Fisher on December 19th, 2014 [ permalink ] | Read more »
WarChest and Splash Damage Annouce Their...
WarChest and Splash Damage Annouce Their New Game: Tempo Posted by Jessica Fisher on December 19th, 2014 [ permalink ] WarChest Ltd and Splash Damage Ltd are teaming up again to work | Read more »

Price Scanner via MacPrices.net

13-inch 2.4GHz Retina MacBook Pro (Apple refu...
The Apple Store has previous-generation Apple Certified Refurbished 13″ 2.4GHz/128GB Retina MacBook Pros available for $999. Apple’s one-year warranty is standard, and shipping is free: - 13″ 2.4GHz/... Read more
Apple resellers offer free overnight shipping
The Apple Store is now offering free next-day shipping on all in stock items if ordered before 12/23/14 at 10:00am PT. Local store pickup is also available within an hour of ordering for any in stock... Read more
Holiday sales continue: MacBook Airs for up t...
 B&H Photo has 2014 MacBook Airs on sale for up to $120 off MSRP, for a limited time, for the Thanksgiving/Christmas Holiday shopping season. Shipping is free, and B&H charges NY sales tax... Read more
Holiday sale continues: 13-inch Retina MacBoo...
 B&H Photo has new 13″ MacBook Pros on sale for up to $150 off MSRP as part of their Holiday pricing. Shipping is free, and B&H charges NY sales tax only: - 13″ 2.5GHz MacBook Pro: $979 save... Read more
Holiday sale continues: 15-inch Retina MacBoo...
 B&H Photo has the new 2014 15″ Retina MacBook Pros on sale for up to $300 off MSRP for a limited time. Shipping is free, and B&H charges NY sales tax only: - 15″ 2.2GHz Retina MacBook Pro: $... Read more
Holiday sale: 13-inch 128GB MacBook Air for $...
 Best Buy has the 2014 13-inch 1.4GHz 128GB MacBook Air on sale for $849.99, or $150 off MSRP, on their online store. Choose free home shipping or free local store pickup (if available). Price valid... Read more
13-inch 2.6GHz Retina MacBook Pro on sale for...
Best Buy has lowered their price on the 2014 13″ 2.6GHz/128GB Retina MacBook Pro to $1149.99 on their online store for a limited time. That’s $150 off MSRP and the lowest price available for this... Read more
Kodak Returns to CES With New Consumer Produ...
Former photography colossus Kodak is returning to CES for the first time in three years where the Kodak booth (#21818 South Hall 1) will showcase a wide range of innovative, imaging-related products... Read more
Invaluable Launches New Eponymously -Named A...
Invaluable, the world’s largest online live auction marketplace, hhas announced the official launch of the Invaluable app for iPad, now available for download in the iTunes App Store. Invaluable... Read more
IDC Reveals Worldwide Mobile Enterprise Appli...
International Data Corporation (IDC) last week hosted the IDC FutureScape: Worldwide Mobile Enterprise Applications and Solutions 2015 Predictions Web conference. The session provided organizations... Read more

Jobs Board

*Apple* Store Leader Program (US) - Apple, I...
…Summary Learn and grow as you explore the art of leadership at the Apple Store. You'll master our retail business inside and out through training, hands-on experience, Read more
Project Manager, *Apple* Financial Services...
**Job Summary** Apple Financial Services (AFS) offers consumers, businesses and educational institutions ways to finance Apple purchases. We work with national and Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, you're also the Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.