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
$100.96
Apple Inc.
-0.83
MSFT
$47.52
Microsoft Corpora
+0.84
GOOG
$596.08
Google Inc.
+6.81

MacTech Search:
Community Search:

Software Updates via MacUpdate

WhatRoute 1.13.0 - Geographically trace...
WhatRoute is designed to find the names of all the routers an IP packet passes through on its way from your Mac to a destination host. It also measures the round-trip time from your Mac to the... Read more
Chromium 37.0.2062.122 - Fast and stable...
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. FreeSMUG-Free OpenSource Mac User Group build is... Read more
Attachment Tamer 3.1.14b9 - Take control...
Attachment Tamer gives you control over attachment handling in Apple Mail. It fixes the most annoying Apple Mail flaws, ensures compatibility with other email software, and allows you to set up how... Read more
Duplicate Annihilator 5.0 - Find and del...
Duplicate Annihilator takes on the time-consuming task of comparing the images in your iPhoto library using effective algorithms to make sure that no duplicate escapes. Duplicate Annihilator detects... Read more
jAlbum Pro 12.2 - Organize your digital...
jAlbum Pro has all the features you love in jAlbum, but comes with a commercial license. With jAlbum, you can create gorgeous custom photo galleries for the Web without writing a line of code!... Read more
jAlbum 12.2 - Create custom photo galler...
With jAlbum, you can create gorgeous custom photo galleries for the Web without writing a line of code! Beginner-friendly, with pro results Simply drag and drop photos into groups, choose a design... Read more
Quicken 2015 2.0.4 - Complete personal f...
Quicken 2015 helps you manage all your personal finances in one place, so you can see where you're spending and where you can save. Quicken automatically categorizes your financial transactions,... Read more
iMazing 1.0 - Complete iOS device manage...
iMazing (formerly DiskAid) is the ultimate iOS device manager with capabilities far beyond what iTunes offers. With iMazing and your iOS device (iPhone, iPad, or iPod), you can: Copy music to and... Read more
Xcode 6.0.1 - Integrated development env...
Apple Xcode is Apple Computer's integrated development environment (IDE) for OS X. The full Xcode package is free to ADC members and includes all the tools you need to create, debug, and optimize... Read more
Apple Safari 7.1 - Apple's Web brow...
Apple Safari in OS X Mavericks brings you all-new ways to find and enjoy the best of the web. It works with iCloud to give you a seamless browsing experience across all your devices. It looks out for... Read more

Latest Forum Discussions

See All

View Source – HTML, JavaScript and CSS...
View Source – HTML, JavaScript and CSS 1.0 Device: iOS Universal Category: Utilities Price: $.99, Version: 1.0 (iTunes) Description: View Source is an app plus an iOS 8 Safari extension that makes it easy to do one key web developer... | Read more »
Avenged Sevenfold’s Hail To The King: De...
Avenged Sevenfold’s Hail To The King: Deathbat is Coming to iOS on October 16th Posted by Jessica Fisher on September 19th, 2014 [ permalink ] Just in time for Halloween, on October 16 Avenged Sevenfold will be launching | Read more »
Talisman Has Gone Universal – Can Now be...
Talisman Has Gone Universal – Can Now be Played on the iPhone Posted by Jessica Fisher on September 19th, 2014 [ permalink ] | Read more »
Tap Army Review
Tap Army Review By Jennifer Allen on September 19th, 2014 Our Rating: :: SHOOT EM ALLUniversal App - Designed for iPhone and iPad Mindless but fun, Tap Army is a lane-based shooter that should help you relieve some stress.   | Read more »
Monsters! Volcanoes! Loot! Epic Island f...
Monsters! Volcanoes! Loot! | Read more »
Plunder Pirates: Tips, Tricks, Strategie...
Ahoy There, Seadogs: Interested in knowing our thoughts on all this plundering and pirating? Check out our Plunder Pirates Review! Have you just downloaded the rather enjoyable pirate-em-up Plunder Pirates and are in need of some assistance? Never... | Read more »
Goat Simulator Review
Goat Simulator Review By Lee Hamlet on September 19th, 2014 Our Rating: :: THE GRUFFEST OF BILLY GOATSUniversal App - Designed for iPhone and iPad Unleash chaos as a grumpy goat in this humorous but short-lived casual game.   | Read more »
A New and Improved Wunderlist is Here fo...
A New and Improved Wunderlist is Here for iOS 8 Posted by Jessica Fisher on September 19th, 2014 [ permalink ] Universal App - Designed for iPhone and iPad | Read more »
Evernote Update for iOS 8 Adds Web Clipp...
Evernote Update for iOS 8 Adds Web Clipping, Quick Notes, and More Posted by Ellis Spice on September 19th, 2014 [ permalink ] | Read more »
Apple Names Ultimate Productivity Bundl...
Apple Names Ultimate Productivity Bundle by Readdle as the Essential Bundle on the App Store Posted by Jessica Fisher on September 19th, 2014 [ permalink | Read more »

Price Scanner via MacPrices.net

Mac Pros available for up to $260 off MSRP
Adorama has Mac Pros on sale for up to $260 off MSRP. Shipping is free, and Adorama charges sales tax in NY & NJ only: - 4-core Mac Pro: $2839.99, $160 off MSRP - 6-core Mac Pro: $3739.99, $260... Read more
13-inch 2.6GHz/256GB Retina MacBook Pros avai...
B&H Photo has the 13″ 2.6GHz/256GB Retina MacBook Pro on sale for $1379 including free shipping plus NY sales tax only. Their price is $120 off MSRP. Read more
Previous-generation 15-inch 2.0GHz Retina Mac...
B&H Photo has leftover previous-generation 15″ 2.0GHz Retina MacBook Pros now available for $1599 including free shipping plus NY sales tax only. Their price is $400 off original MSRP. B&H... Read more
21″ 2.7GHz iMac available for $1179, save $12...
Adorama has 21″ 2.7GHz Hawell iMacs on sale for $1179.99 including free shipping. Their price is $120 off MSRP. NY and NJ sales tax only. Read more
iOS 8 Adoption Rate Slower than iOS 7, 6, Hit...
Apple began pushing out iOS 8 updates to eligible devices around 1pm ET on September 17, 2014. However, unlike with iOS 7, which boasted a wide variety of differences from its predecessor iOS 6, in... Read more
LIkely Final Definitive OS X 10.9.5 Mavericks...
Apple has released what will almost certainly be the last incremental version number update of OS X 10.9 Mavericks (save for futire security updates) before OS X 10.10 Yosemite is released next month... Read more
Fingerprints, Apple Pay and Identity Theft Wa...
On Sep 9th, CEO Tim Cook unveiled Apple Pay, along with the new iPhone 6 and iWatch. Apple Pay is a newly developed technology that utilizes a near field communication (NFC) to enable customer... Read more
Amazon Introduces Two All-New Kindles
Amazon on Thursday introduced the 7th generation of its Kindle dedicated e-reader device: Kindle Voyage, its top-of-the-line e-reader, and the new $79 Kindle, with a 20% faster processor, twice the... Read more
Save up to $300 on the price of a new Mac wit...
Purchase a new Mac or iPad at The Apple Store for Education and take up to $300 off MSRP. All teachers, students, and staff of any educational institution qualify for the discount. Shipping is free,... Read more
13-inch 2.8GHz Retina MacBook Pro available f...
B&H Photo has the new 2014 13″ 2.8GHz Retina MacBook Pro on sale for $1699.99 including free shipping plus NY sales tax only. They’ll also include free copies of Parallels Desktop and LoJack for... Read more

Jobs Board

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...
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
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.