WWDC2001 Session 124

Transcript

Kind: captions Language: en [Applause] good afternoon it's Mike working so when it came time to put the slides together for this year we look back at what we've done for the last couple of years about two years ago we talked about the architecture and a bunch of AP is last year we went through API is again showed you how to write plug-ins for the print dialogues so this year we're going to do something a little different and the agenda is basically the topics that have spawned the most amount of email between developers and us to the various developer mailing lists over the last year the topics that have been the most interesting to discuss with the developers and in-house hopefully if you've got a little bit of something for everybody we've got do's and don'ts for carbon a little bit of information about how Coco glues on to the underlying printing system a little bit on UNIX printing in the systems and diagnostic tools and we'll end up talking a little bit about printing in color before I go on I want to say thanks to everybody here who has reported bugs against printing has been appreciated it's kept us busy and also thanks for all the suggestions for improvements which we'll work on so before we get into this I got one slide that some of you may have seen before so hands up all those who've seen this slide well that's very interesting because all the printing engineers didn't put their hands up so that's why we've got these bugs so I'm going to explain to the printing team and some of you very quickly how the architectures put together mainly so that you understand the terminology we're going to use in subsequent slides and I was thinking of doing this with my eyes shut because I've done it so many times before but I'll probably fall off the stage so we'll start over on the your left towards the top where your applications linked against the pudding framework that's the box we call the print job creator that serves up all the api's that are in the two main printing headers PM core PM application PM application for the UI related api's PM core for all the rest those api is let you set up what we call the page format object and the print settings object bring up the print dialog and execute the print loop and a result of that you get a print job as a print job is that PDF spool file shown here and a meta file we call the job ticket the job ticket contains most of the settings you put in you the user does in the print dialog and a bunch of other things that are needed for processing the job downstream underneath that print job crater is a plug-in print dialog extensions and those are CF plugins can be written by application developers by printer driver developers and they're written by us in the printing team and they basically add panels to the page setup and put dialogues to add features you know everything from the main panel and page setup where you pick your paper size and orientation etc to copies and page range in the print dialog those are all all those panels come from these print dialog extensions moving across we have the print server print server is going to think of it about it as the nerve center of the printing system it's responsible for sending print jobs downstream from the print job creator and relaying status and error information back up to the UI from the modules which we'll talk about in a second print service its own process and manages all the cues when a job is ready to print print server runs process call the print job manager and it as its name implies and does everything that's needed to do to get a job printed runs these modules over on the right in separate threads the first one we call the convertor actually that's a bit of an oversimplification the converters are set of libraries that do various things to do with converting from one graphics format to another so for example there's a converter library that turns PDF into raster data one's going to turn PDF into PostScript converter is also used up in the front end of the printing system to generate the spool file itself so it's involved in turning quick-draw drawing into a PDF spool file or quartz 2d drawing into a PDF spool file next one down the printer module the printer module is pretty much the only thing that's left of classic print drivers classic print drivers used to do everything themselves UI spooling quick-draw conversion choose a pax IO everything now the system is a lot more modular printer modules basically all they have to do these days is tell the converter what sort of data they want and once they receive that data package it appropriately and send it to the printer so in the case of a raster printer module it would tell the converter you know the the color space and the resolution of the raster data rate wanted as it received bands from the converter to compress them insert some engine control codes and send them off downstream talking about talking to the printer that's where the i/o modules come in those are today mainly written by Apple we have an i/o module for Apple talk printing for LPR printing for USB the list can go on we'll probably add to it also third parties can add to it down the bottom printer browsers those provide the UI for the i/o modules to basically provide the UI for discovering printers so there's one for using the NBP protocol to discover appletalk printers one scans the USB bus looking for printers and those printer browse the modules are actually loaded by the last box on this slide which is print Center which is the application that presumably everybody's used the application that's used for setting up print queues monitoring and managing print jobs so that's the architecture in a nutshell the one thing I'd like to say is it's a lot more modular than whatever we used to have in Mac OS 9 and 8 and earlier versions it's a lot more extensible and our goal is that hopefully we're partially achieving that is that if you're in the business of writing printer drivers or even if you're in the business of running applications to do a lot of printing Apple's done a lot more work for you than youth than was the case in the past ok so back onto the agenda we're going to talk a little bit about carbon printing and we've got to cover both printing from carbon apps running on Mac OS 8 and 9 under carbon lib as well as carbon apps running on 10 and you're probably aware the printing system underneath those two environments is very different that raises some issues and that's why we need to talk about some of them here my first slide here is probably exactly the same as one I had last year although I didn't check the message is use the API so take a session argument as opposed to their counterparts which don't if you're familiar with the headers you'll see there about it was about 40 api's where there's a non session and a session version and it sounds a bit crazy there's a historical reason behind that originally the non session api's appeared because we were doing the carbon thing trying to minimize the effort of for developers bringing applications over to carbon so the API to them basically intended to match the classic printing manager and just provide a lot of access to functions for things that used to be in the print record and then somebody had the bright idea to have document mobile printing intent so we had to have some sort of context to carry around with a lot of these api's as a result we decided to come up with a parallel set of api's which take a session parameter and that way we can manage printing within an application pretty involved all documents and concurrently so our favorite API so the session ones those are the ones we'll carry forward if you're using the non session ones we're likely ask you to switch over to the session ones what you've probably noticed in the last CSS we've added new api's their session only that's one way of coercing you into doing the right thing putting up here and notice they we will deprecated the non session ones eventually not this year but soon and all of sudden sample code uses a session api's a couple of technical restrictions one is that when you're running on 8 & 9 you limit it to a single session and that's just because of the nature the underlying printing system with you know the print dialog being system modal for example so you have to check your environment at runtime if you're running on 8 & 9 under Carbon lib limit yourself to one session on 10 you know as many as you like every window can have its own print dialog for example if you are using multiple sessions you should be aware of the fact that the page format and print settings objects can be shared amongst those sessions pretty much the only limitation but an obvious one is that each session can only have one print dialog up as at any particular time so somewhat related to that is using sheets for your print dialogues and you can't do this on page 9 but you can definitely do it on 10 and we want you to do it on 10 you want it to be the standard user experience for printing actually not all Apple applications do it right now and they should so hopefully that will happen quite soon obvious benefits of the dialogues appearing as sheets is that they're they're putting controls always in a predictable place relative to the document window and the other nice thing is that you can the user can switch from you know one window to another from one application to another the dialogues no longer modal so either the application of the system the two api's they're up there if you're running at runtime you want to check your environment before you start using p.m. session new sheets because you can't do this thing online even though you can bring up a print dialog for each open document window whether or not you want to spool multiple documents in parallel is up to you can be tricky if you're a quick-draw based application you've got to carefully coordinate your use of printing ports there's actually a limitation on cocoa apps at the moment because the spooling dialogue is modal but we'll get rid of that in a future release I'm sure so you can print multiple documents or spool multiple documents in parallel but be a little careful on that I mentioned that carbon lib printing you don't get sheets basically you get the classic drivers print dialogues and I've got this bully datum on several slides we have got sample codes in the posted online documentation so I'm gonna develop a CD it's a little out of date now we are improving it until we can get another developer CD out we are actually going to provide more sample go to DTS and so DTS will be able to post this sample code hopefully quite soon another UI related thing is how do you extend the print dialog when I say print dialog I mean the page setup and print dialogues and message here is to write these print dialog extensions instead of using the old append little mechanism append it all was the way in which you used to extend the print dialog back on all the versions of the OS using p.m. dialog in it and main calls and little kludgy you really had no control over how you can lay out your controls for whatever prints print specific features you had what you can do with PD ease is the you can have if you like multiple panels added to the print dialog all the page setup dialog for that matter lay them out exactly as you like so it's a lot more powerful the only restriction is the p d--'s are only supported on ten a couple of things to dimension in connection with PDEs is that you can you're welcome to write p d--'s and add any features you like but we would definitely like you to talk to us before you start doing that you don't have to register PDEs because they are plugins they use the UUID mechanism so they're all sort of by definition we unique but would rather you didn't write a PD for a feature that you know deep down is something that Apple should do and if you're an application developer would rather you didn't write a PDE for a feature that really should belong to the printer should be supplied by the printer module and vice versa or if you're developing through the modules 410 we don't want you putting features in that really should be provided by Apple or maybe your application specific so you're very welcome to run your ideas by us and we'll give you some advice we'll certainly tell you if we're planning to write a PDE for a feature that you think you need and we're acutely aware of the fact that there are some that we should write an ad and we're working on that so patience is always appreciated I should mention in connection with PDE s that we strongly encourage you to think about the UI design and the layout to you know follow apples example if you're a printer module you may be very tempted to make your UI look exactly like your print dialogues on Mac OS 9 or 8 or haven't appeared on some other platform and we strongly encourage you not to do that to take a step back look at how things look at how things look on Mac OS 10 and fit in with that certainly users don't want to see any inconsistency as they switch between one panel and another or between one printer and another so same applies to application developers you might want to do some things that look just like your application printing extensions on 8:00 or 9:00 but try to do the accurate thing if you can and certainly we're here to give you advice if you have any questions about that let's see so if you're an application developer and you've added a panel for the print dialog you want to know what the user did in that panel so the two routines down here are used for that purpose your plugin is going to call PM session set data in session and you can use the get call to fish that out and then your application main line code is going to know what it needs to do in the print loop again sample code from pts one small thing that's probably worth mentioning is that you do have a choice when you're building your PDEs as to whether to build them as pair for marco code even if you're a CFM app there's glue code from DTS so it's your choice it's perfectly doable and I think it's certainly something we need to look into more closely but I think you can even use IB to build your PDEs I know of one developer who managed to do that okay now plug for few ap is that we certainly use in our sample code is it not exactly taking at random but there are a lot of api's in PM core PM application some of them have rather specialized purposes others hopefully are obvious why you should use them but there's a lot of API so may not be obvious which ones you should use here so here are a few that we encourage you to use all the time first one PM set your name CF string is function you should call to name your print job by default if you don't call this routine will will get the window title and use that but their applications that don't necessarily have windows or have multiple windows and do strange things at print time so this is a great way of providing a user-friendly meaningful name that name will be displayed by Print Center in the queue window it'll be displayed as a default filename if you're printing the disk we'll put it in a job title comment in PostScript files we generate news in various other places so please use that routine P and set page range is quite a useful API as well you use it basically to tell our copies and pages panel how to limit the from two fields when the users typing in the pages they want to print you can use this in connection with another routine p.m. set last page to prime the print dialog so you can actually tell the user what the first page and what the last pages are in the document and it prevents people you know typing crazy numbers in there and then your application has to deal with that in the print loop PM session error you really need to use this in your print loop and you ought to be made you have to make sure that you always call it before the begin page function and if you do detect an error with this routine don't bail immediately what you should do is you make sure you call the end document routine that allows us to clean up any memory we've allocated and then you can safely get out of the print loop just post your error message if you need to and exit cleanly you should use p.m. session set error within the print loop to set your own error codes or our conditions that will be picked up after that page has been processed by p.m. session error PM session set error is the way you register your sort of application specific error conditions that you encountered while trying to draw your pages obviously you don't want to use it for is to overlap any of the error codes we returned from the PM functions so try to use those routines and we always use them in our sample code so how many people remember the original articles called the perils of postscript 10 11 years old I mean years old they were written okay written by a guy called Z Z Zimmerman whose I think the originator the dog cow pretty famous guy in this time and I'm certainly not trying to emulate what he did which is a lot better than what I'm doing today but if we're talking about some of the tricky aspects of mixing postscript with quick-draw when you're printing I mean historically every application that's had moderate to sophisticated drawing requirements or capabilities has had to resort to PostScript at print time obviously if you're only printing to a postive printer as quick to already won't cut it you know for things like smooth shading etc so for a long time application developers have been using pet comments and settings sniff it's a postscript or huge chunks of PostScript in their pics pool files and getting to know the idiosyncrasies of different versions of print drivers etc we've recognized that the folks who've written these sort of applications probably got a lot of code they need to bring over to ten they can't do it immediately and we'd obviously like you to go towards the PDF imaging model but in the meantime we do have what we call the laser ivory compatibility path imprinting so you can tell the printing system that you want to pick with PostScript spool file instead of a PDF full file these are the two routines you use to do that you call p.m. session get document format generation to get back a list of spool file formats that are supported and obviously you've got to call this after the print dialog spin just nest because before that nobody knows that what the target printer is and whether it's the PostScript printer so call it after the print dialog has been dismissed you get back a list the list will always contain PDF as a sported spool file format and maybe it's going to contain pictures PostScript if the target printer supposed to a printer having discovered that you can then call PM session set document format generation parsley and pick with PostScript is your preferred format and basically from that point on when you when you draw your pages in the print loop you can use pick comments and insert your own PostScript there is sample code already in on the developer CD and it's not bad but I think we got a better version coming out very soon and going through DTS so those are routines you should use there's a routine that's in PM core called PM is PostScript driver it might sound like it does the same thing it doesn't it just tells you whether the current printer basically tell us about the current printer ease laserwriter rate or whether the current printer on agent 9 though it's W do field is 3 so you could use it on 8 and 9 to see if you're printing to it those are a great or WPS but don't try to use it on 10 for this purpose so having told the printing system you want to generate your own closed script these are the 5 pick comment routines you can use to put your PostScript in I say be careful with postscript anybody's doing this stuff already knows why you have to be careful it's only designed for inserting PostScript in page drawing to supplement what you're already doing with quick-draw be careful especially be careful about assuming about existence of resources like font resources etc the space ax does still work but if you've got code that is currently compatible with laser a great it's going to be compatible with this method of printing on 10 there used to be a mechanism to send your own PostScript procedures down with the print job goes by the name of the P rec 103 mechanism it's a resource you have in your application that's the way in which you get your own PostScript into the header or into the document page set up sections of the print job you can still use P rec 103 but there's a much better API and mechanism for doing it and that is sessions that post script injection data routine and it's documented and it's NPM core today basically you provide a dictionary of key value pairs the keys are tags into the post script job and the values that sniff it's a post script you want us to insert at specific places gives you fine control over the post script job you generate we still obviously have to be careful about what you're doing but it's a lot better than P rec 1 & 3 and you should use it if you are forced to use the load arrival rate compatibility path 1:10 a couple of disadvantages for obvious disadvantages of using all this stuff the first thing is the preview which the preview app we use for previewing school files can handle PDF but we don't have a postscript rip in the system so if you're doing the PostScript printing path on 10 you can't preview your documents what's more if you're doing this one day we'll support drag and drop in Print Center and you'll be able to drag spool files from one print queue to another or documents onto queues for example and you can't drag a postscript spool file onto a queue for a raster printer because we can't render PostScript so use this stuff if you need to if it's a short term solution for getting onto ten but go to the graphics and imaging Tips & Tricks session tomorrow morning at nine o'clock where my colleagues sitting in the front row there it's going to tell you a lot more about quick-draw and quartz 2d and I think you find the information you get out of there really shows you a much better way of doing sophisticated printing on 10 then the old quick-draw and postcode round now for a topic that is generated a ton of email a lot of bug reports actually we've put a lot of bug fixes in Carbon live the issue is how we get routines like p.m. set get scaling resolution orientation etc to work accurately when you're printing through carbon Live Mac OS 89 and the issue is that different print drivers classic rent drivers do you store things in different places encoded in different ways in the print record and actually it's worse than that I mean they they interpret the data in in unpredictable ways run into a driver recently where if zero was the scaling factor that meant 100% scaling so it's difficult for us algorithmically to figure out how to deal with all these different print drivers print records so what we've done and we've been doing this for the last year or so we've been encouraging printer driver developers to help us create this database which we call the p dot database that's inside a carven live it contains information that tells us for these various settings like copies and orientation you know the offset into the print record the size bit bars to separate the parameter from its neighbors and some information to handle the interpretation of the setting you know enumerator types like page orientation or scalars but about the decimal point for things like scaling and resolution so it's pretty good there's about 40 feet ATS in comminuted a covers about 250 or drivers but there are other drivers out there and you'll probably encounter them or your customers will encounter them and they'll complain and you tell us and we'll talk to the driver developer and we'll add another P dot that's the way it works and in the meantime code defensively it's just as bad as the situation when you would printing directly to those drivers on 8:09 you know last year or the year before so it's a compatibility problem we're working on it it's getting better but we certainly appreciate you know your support and bug reports just just fine way of doing it similarly some of our routines like the ones listed here use the pr general function again under carbon Lib against the classic drivers and for those to work reliably we need that driver to support the various opcodes associated videos phone if the driver doesn't support that opcode the only thing we can do is return KPM not implemented and you have to deal with that again it's no worse than the situation ever was but the message is if you are printing through carbon they'd be careful because there are some drivers out there that we don't know how to handle yet all right probably going to trip over myself on this one they'll try to talk about some page and paper rect issues so first of all terminology the formatting printer is the printer you see in the page setup dialog on 10 we are gently trying to educate users that when they format a document it's not necessarily going to be printed to the same printer that they format it for and it might well be printed to a variety of printers so we've introduced this entry in the pop up called any printer which we call the generic printer the idea is that these are actually the user who doesn't care isn't even going to bring this dialogue up and they'll never see anything that but when the page format object is created will create it for this generic printer which has associated with it a set of standard papers and a set of a safe margins if you if you go into the page setup dialog you can pick another printer one of the printers that you see if you set up and print Center and you can pick a specific paper size supported by your printer and you will get courtesy of the printer module downstream exact margins for that selected paper size but the important thing is that whatever you format your document for is quite separate from what happens when you decide to print that document so the formatting for printer is totally independent of the printer entry that you see in the print dialog and it's a little bit of a leap of well so it's a change of model for some users but we feel that it's a sensible step in the right direction so the current and the default printers those only those are only relevant in the context of printing as in the print dialog when you bring the print dialog up for the first time the printer pop up will always contain the name of the default printer the default printer is the print II set in print center typically that's the last printer you set up and if you fiddle with the pop up you can change the printer entry so you're changing at that point the current printer so there are cases where you will format for one printer and print to another and that's fine I mean we've got this nice PDF imaging model we can handle mapping you know the document to different paper sizes the default behaviour right now is we clip but we'll we'll provide some more functionality to allow people to do things like scale and Center their pages on the paper but the main thing for people to come to terms with is the fact that formatting for printer is very different from the current printer that you see in the print dialog let's see what else to say about that you can't you can't change there's no programmatic way of changing the default printer that is the users decision the user can do that through Print Center today you can't change the current printer it's Roni api's but we do recognize that there are some applications that want to do this sort of thing if you're writing a printer utility for example you might want to do it so here are a couple api's p.m. session create printer list and PM session set current printer which respectively will give you a list of the printers that you see in print center and they will let you change the current printer they're not available today they will be available in some future release and I think if you write to DTS and a week or so from now they'll be able to provide you with some details again you can't use them today but if you are trying to do functionality that requires access to the printer we do have a solution for you the other thing I need to say we're a bit of a confession really is that the page setup dialog doesn't exactly work the way it's supposed to in ten point O or ten point oh one two and three but we are fixing it I'm sure you've noticed if you go to the page setup dialog pick a printer pick a paper size okay the dialog and then come back to it later it doesn't appear that the settings have stuck so we are very well aware of that problem and we have I think it's safe to say we fixed it so you'll be getting those fixes hopefully quite soon a few words about paper and pages and the first thing I have to say in connection with these routines that are generally used by applications that are trying to format a document that maybe have come from another platform or the informative or another printer without using the page setup dialog these routines you have to be very careful about using them on eight and nine because there's no programmatic way on eight or nine to tell the driver what to put in it well to put different our paper our page settings into the print record without going through the drivers page setup dialog so the api's are they're using carefully on 8 and 9 they do work on 10 as advertised or as expected so you really you have a lot more control over your paper and page racks on 10 if you're going to print without the UI you can do that and you've got reasonable amount of control over margins the last bullet item here is extremely important before you call any of the get functions to get the page rect for example always make sure you call the validate call after any set call to set orientation set scales that resolutions set pay per page right because that's the only time we sync everything up in fact we're even fixing a few bugs in that routine so we will get it right very soon so that's pretty much all I've got now for carbon just to recap do use the session api's display your print dialog the sheets on 10 develop your own PDEs go to tomorrow morning session look for teas in course 2d instead of mixing up quick draw and PostScript and program defensively when you're running in hol on 8 & 9 on carbon live we do our best compatibility is getting better but be aware of some of the issues we face now we're going to switch horses for a moment to talk a little bit about cocoa printing but I'm not gonna do just tell you what to do in your application because there's a session straight after this advanced cocoa topics in Hall 2 and there's a lot more information there so I encourage you to go to that session if you're a cocoa app developer and want to know a bit more about how to do printing right what I'm going to talk about is the relationship between the applique printing classes there's only four of them that are really relevant for printing and the underlying printing system so we're just going to go through these classes fairly quickly I'll just try to explain how they map to each other the first one and it's print info if you're looking at a sprint info look at the online documentation or look at the code itself you'll see it's a dictionary that contains all the settings that usually associated with a page setup and print dialog so in theory it maps directly to our page format and print settings objects it's a cocoa application you automatically get a shared and it's print info object this there's always the notion of a cut of a current one that's used for the current print operation you can create multiple instances of it there are access to functions for the various things that are stored in a nice print info although most of them are changed by bringing up a dialog the page setup and print dialogues the thing that we need to do we need to sink and it's print info a little bit more closely with page forward and print settings because there's a couple of things in a sprint info that aren't supported by the underlying printing system we need to take care of that and vice versa there's a couple of things that we have in the underlying print system that aren't in in a sprint info it's a few things like an S print infos got some fax settings which we don't carry through downstream the underlying printing systems got settings for things like print quality modes and and things like that so we'll be thinking those two up and it's page layout basically that's the page setup dialog and you really don't have to do a lot a lot of coding with and it's page layout it it basically accesses an S printing process things like the paper size and there is scaling orientation for the document the one thing I want to point out is that you can invoke it in two ways you can invoke is the modal dialog and you can invoke it as a sheet so you'll know which one you should do one thing I could have mentioned is that you can extend the page setup dialog in a cocoa app but very few applications that need to do that and it's print panel which is a print dialog obviously you can do the same thing you can add an accessory view and it's sort of equivalent to print dialog extensions for carbon applications you can add a view put your application in specific print settings in it the only restriction today with cocoa abscess that you're going to have one access review well I'm sure we'll work on that and enable you to have more if you need them and actually if you need to do that sort of thing I think you should tell Apple so we understand the priority for that and obviously and it's print panel sets of things you known as print info that you see in the dialogues like copies and page range etc and last to know I know his least is an S print operation where all the good stuff happens we're in all down the file menu hit print you create an S printing for print operation that takes a copy of Anna's print info brings the print dialog up merges the results back in tennis print info and then it's up tennis view to do all the real work and as few draws all the pages goes into the school file a PDF spool file and that spool file goes through the rest of the printing system just like any other print job maybe from other koko apps or from other carbonate basically that's it there's very little for you to worry about for koko printing and it's the details in the next session there's a little bit of work for us to do to more tightly think the applicant classes up to our underlying data structures but it works pretty well today now for the power of printing sorry the power of UNIX and printing so we don't expect a lot of consumers to do printing from the command line but maybe some of you guys in this room will want to do that occasionally so you can the LPR family is in the bsp layer and LPR works just a couple of things to mention today LPR and this associated tools like LPC lb ql PRM etc they work but they're not really well integrated with the rest of the printing system in other words for example when you say LPR - P want to type in your printer name you can type in necessarily any of the print queue names that you see in print Center the only exceptions of that is that you can use printer entries that sort in net info so you can put net info printer entries in when you're lpr printing the other thing of course with LPR is that you don't get user-friendly status and error messages if anything goes wrong and you're limited in the file types you can print generally text and postcode files work well and I was not so well so help you I worked but there's actually a better tool and if you haven't found it already it's just called the print tall it's in user s bin the difference is that the print tall is actually integrated with the rest of the printing system so when you specify your printer you can specify any printer Q name that you see in print Center you can for example print PDF files to raster printers using the printer there's an N up flag you can use - nu so you can print your files to up for up etc so and and once you've printed you can see that your jobs in the queues along with everything else if I print Center so if you want to do command line printing print is a little better than LPR at the moment LPD is in the system obviously it's used when you print through LPR it's not it's not set up by default to enable remote printing but you can do that so if you know what you're doing you can edit the config files and you can run the LPD you may be from a startup script and other clients on the land can print to your LP d.school are running on your system - whatever printers you're set up for so LPD works it's not our long-term solution for print sharing but it's there I mentioned a moment ago net info something you may not know is whenever you set up an LPR printer in Princeton until we actually create a local net info entry I'm not gonna get into net in focus I'm definitely not the right person to talk about it but that's net info is a very convenient way of making suddenly making LPR printers available to everybody on the network without them having to know their domain names or IP addresses or anything like that but you can't use Print Center to create global net info entries or node info entries that are exported to hire network domains you have to use that info manager to do that and you have to be appropriately privileged to be able to create Network wide and that info things so you can do it if you're going to create a printer entry the print Catman page tells you about the keys that you have to put in you have to be careful there I mean we have to know you have to be exactly right when you specify the name of the printer on the name of the machine that's running LPD for example one instance there which I'm flagging there's a key Y key which we use the value associated with that we use to find the PPD file for the PostScript printer associated with that net info entry and and that infos limited in the byte codes it can accept it doesn't like forward slashes and spaces for example some PPD files may have those in the filename so if you're going to put the PPD name in the entry you can replace those slashes and spaces with an underscore so some subtleties there I'm sure DTS can can handle questions on it but it's a nice way of making your printers available to everybody on the network so it's demo time so it's Phil Schiller here yeah ok so I'll do the demo [Applause] well we're already running terminal it's going to be a very exciting demo so exciting that I think a lot of people may want to leave now all right so we're running top over here just so that you can see what's going on not much happening right now though we've got four incidental running down here let me say a few words about Cpl util first of all it's a tool that was written a while back when we're developing the printing system it was developed it was written for internal uses originally but it's become quite useful for you know for people who are doing print testing people to trying to troubleshoot print jobs especially for printer driver developers but if you're feeling brave and you're having a printing problem Cpl util is great way of finding out if for example print queues that got corrupted in some way when a job fails whether a how far the print job got through the pipeline so I'm going to show you a little bit about Cpl detail but by no means give you a comprehensive walkthrough so so if we go to developer tools we'll see oops where are we Oh CD course this requested I can type see a bunch of things in there that apple provides the don't understand at bsd set but there's Cpl util so we can can run Cpl util and first off get ready for the scrolling we can see all the things that Cpl util does we're not going to try many of these commands but here's one that we can do show work set printers is a command we can use in Cpl util to see what print queues we've set up so we can do this and we can see oh I don't have any print use so let's go to well before we do that and let's get Print Center let's get Cpl util listening to all the things that the print server does that'll be one way of seeing whether operations like creating a queue opening a job work successfully so first thing I'm going to do is I'm not going to trust my typing we're going to start the server and top has chiefly shows the print server is now running so now we can you can listen to service so what we're doing now I mentioned earlier on that print server is the nerve center of the system so we're now listening on a port to print server but we're finding out everything that happens if user creative jobs are printed if cues are deleted etc so we're listening to print server at this time what we're going to do is we are going to run print Center down here and we're going to add a printer and I just happen to have down here a USB printer it's on and hey presto I can see it I can create a cue for it and see a few things happen and what you'll see in the CPL you to log is you'll see that a cue has been created you'll see the name of the cue and you'll see another bunch of other information this rather unused a friendly string is the name of the cue directory that we've created in vast ball printing if you had appropriate privileges you could navigate down there go into that directory and you'd find a bunch of files it's containing information about the print queue and the printer the directories for the small files etc we won't do that now and you don't really need to do because CPL util is a much easier way of finding out information about the printer or the print queue so we all them will stop listening for a moment and we will will ask it will usually get queue info commands you have to type in everything exactly as it's supposed to be otherwise you recognize get queue info tells me a little bit about the queue that I just created let's see what we've got here here we've got can everybody read this it's not too big sorry about the scrolling and the screen size but basically here we've got the URL to the printer module associated with this queue down here we've got the URL to the i/o module associated with this queue further on if I can find it we've got the URL to the print dialog extension associated with his queue we've got the name of the queue a bunch of other information so you can if especially if you drive a developer you can use this sort of tools to make sure everything got set up correctly so now let's do something a little bit more adventurous and we'll print a job and we'll see what can happen so I will I'll do listen to server again and okay so we're now waiting for something to happen let's go and find a job to print let's do this one I'll print out the other one later if you like so this is a much more politically correct document so let's print it and we're not going to do much we're just going to print it because we're actually seeing what Cpl util does and if we're patient first of all if we were down in print Center we would see that the documents printing sitting over here watching the the log will actually wait for the print job to go through and then we'll take a quick look and you'll see there's basically a sequence of messages that come through it's pretty predictable sequence and it's one way of finding out you know did your job actually get through to it was a small file created was the connection to the printer successfully opened was the job sent to the printer was the connection closed etc so it's one way of monitoring the entire lifecycle of a print job did I mention that we were going to work on printing performance well maybe we are printing let's see the thing to look for when you're looking at this yes if you look at the event text field that's basically the thing to look for that tells you what sort of event has happened so if you don't mind we'll work backwards if you see down here associated with event text we've got the message that the jobs being deleted if we go back your a message that says job state changed that's on the next line down print job completed looks pretty good closing printer connection whew progress come our progress messages so it might sound strange to go through this back backwards but printing job opening printer connection starting job job created so that that's the a healthy life cycle of a successful print job and I know you won't believe me but they page did actually print so that Cpl util I there's a lot of stuff in there that I could show you some of it for some fairly brave people you have to be appropriately privileged to do some things like delete keys etc but if you're suddenly if your printer driver developer maybe for an application developer certainly if you're a tester Cpl utility is a tool that's available and comes in handy sometimes so that's all we've got for the demo so if you switch over to the slides can you switch over to the mean okay just going to mention a couple of other tools related to diagnosing printing problems just to talk about how to deal with troublesome PostScript jobs for a moment there's basically two things that pretty easy to use the first thing is that we have a Poe script error handler that you can download with any print job if you pick up PostScript printer in the print dialog you'll find there's an error handling panel shows up and in there you can there's a radio button to print a detailed report if anything goes wrong if you click on that radio button error handler gets downloaded with a job if anything goes wrong and the printers capable of doing it it'll print out a stack gun it's exactly the same as the same facility we had with laser a great Mac OS 8 and 9 we don't yet but we will soon have the ability to print post code files to disk you can print PDFs pool files to disk everybody knows but we're still working on getting printer PostScript working but there is a way of getting PostScript files written to disk certainly useful for developers and for testers you can set some parameters in your global defaults to turn on a feature which we call job copy the first invocation will or tell us that you were on every postscript print job written to the temp directory the second invocation will tell us that you want those files written to a directory of your choice you do have to be careful to make sure those directories are writable by everybody because the writer of the PostScript isn't running as your applications you I did so be careful there but basically when the job copy feature is turned on every PostScript job gets written to disk we Auto increment the filename if needed and you then welcome to wade through all the PostScript and see what was going wrong especially if you're one of these people who generate a lot of your own post code so there's a useful tools the last topic it's probably the most controversial one talking about it this year because it's important that we emphasize the fact that the printing system the graphic system the color sync system far more tightly integrated on ten than they ever were on Mac OS 8 9 or its predecessors this is all good stuff I mean it's much better than a vertically integrated system but it does have implications that has implications for application developers and has implications for printer driver developers so I mentioned some of those and first thing to talk about are the main differences between printing on 10 versus printing on earlier versions of the OS and first bullet item applications can print and/or can draw their pages in multiple color spaces obviously a lot of Carbon applications are going to be drawing in with quick-draw and RGB but cocoa apps can use any of the PDF color spaces and think things will be drawn in you know device colors device Caray RGB etc and in device-independent CIE color spaces so it's no longer a safe assumption if you're a printer driver developer the source material is going to be drawn in our GB another thing that's different is that everything that goes into the PDFs pull files automatically tagged obviously it's nicer if the application does this but if the application doesn't do it we'll make sure that every shape in the school file gets the profile and gets a rendering intent if the application hasn't done it for us everything gets the system profile images automatically get perceptual everything else line art and text gets relative colorimetric so the PDF spool file we it's everything has a source profile and that it's definitely different from the way things typically worked on Mac OS 8 and 9 should emphasize the fact that this is all we'll be talking about source profiles here we've got a quite a nice clean dividing line between what happens in spalling which is the domain of the graphic system and the application what happens a rendering time which is obviously the domain of the graphic system and printer drivers printer drivers don't get to control the tagging of anything with source profiles and they certainly don't get to control rendering intents so in print drivers on 10 you won't see color panels offering rendering intent options that's all handled upstream when the pool when the spool file is created it also falls out from this that obviously we want good culling profiles in the system not just for printers for displays scanners any sort of input device so obviously this everything's going to work just fine if there's accurate and versatile profiles for all the devices involved in the printing pipeline and of the printers need to have profiles and we obviously work with the print vendors to encourage them to develop good quality profiles the printer modules down on the back end actually provide their profiles when akyüz created we ask the printer printer module to tell us about the destination profile [Music] I'll talk a little bit more about that on the next slide the final bullet item sounds a little controversial to some folks basically no way to turn off color matching the simplification basically there's there's only one scenario in which color values are not changed and that's when the source and the destination profiles are identical in all other cases that the applications drawing in a different color space from the one specified by the printer module we have to match so the couple sinks CMM gets in there and does its thing so typically if everybody's doing the right thing if if everything's being tagged there's a good chance that color data will be managed through the printing system and printer modules will get data that's being matched once it's matched what's PDF is rendered and shape specific information is lost so there are implications for printer drivers in connection with that so let's talk about raster printing for a moment so although everything gets color matched it's not to say the printer drivers don't have a lot to do with final print quality output and color fidelity there's a couple of things they can do here first one there's an image access callback it's probably not as powerful as it needs to be and we'll be working on it but basically this is a callback that enables printer modules to get a image data sampled image data before it's rendered so they get an opportunity to do edge enhancement resample images color balance adjustment whatever if they need to do that and want to do that before the PDF page is rendered to make this system shine and to make it just a great color platform we want every printed route from the driver developer to provide accurate versatile profiles it's most important of course that they cover all the permutations of all the media types are supported by the printer or the print quality modes it's recommended that those profiles include profile connections base tags so we can demise the number of transitions or transformations that happen when we're doing our color matching so it's very important that we get good quality profiles for all the printers on 10 now remember I said that there is a scenario where data can go through unmatched in that case printer module could apply its own color science there's there's really two options for printing modules when they tell the converter what sort of data they want they can emit profile reference in which case we have to make an assumption we have that assumption is that the destination profile is the system profile and we will know if it matches the source profile will do nothing but otherwise we will render to the system profiles color space it's not great because system profile generally doesn't have different conversion mechanisms or generally has the same conversion mechanism for different rendering intents but that the printer module could get data rendered to the system profile and then apply its own color science better than that actually is for the printer module to give us a profile that represents a wide gamut color space and we will render to that space and from that point on the printer module could provide or could execute its own proprietary table based color matching to the to the printer device so generally speaking to enable vendor specific color matching would recommend that the printer module provides this wide gamut profile as a destination space and it's a fairly complicated topic I'm sorry only sort of touching the surface of it we are working on a tech note and hopefully in a few weeks or a month or two we'll have a new tech note out it explains color matching on 10 with respect to printing I need to mention PostScript quickly the the simple way of saying this is that color PostScript printing is handled on 10 exactly the way it was on with laser hydrate on 8 and 9 if you pick PostScript matching and the printers default because what we do is we turn all the source profiles in the PDF spool file into color space in vacations send them down in the print job to the printer use the printers own embedded color rendering dictionary as a destination color space and let the PostScript machinery do the color matching we will probably in a future release allow host-based profiles to be converted to host based printer profiles to be converted to a couple spaces and sent down to the printer so we don't have to use the printers own CID in the case where you've got a calibrated profile that's for the future and that is all I have to say about printing in color just quickly the three follow-on sessions that we'd like you to go to after this if you're a Coco person go to the advanced cocoa Topic session tomorrow morning David is wandering around there it's going to tell you all about how quick-draw and quartz 2ds going to come together that if you've recovered from the beer bash tonight in time get up and go to the 9 a.m. session and last but not least there's a feedback forum tomorrow afternoon for I guess all your questions about graphics color printing and related technologies and with that I'm going to hand you back to Travis thank you Paul okay what I want to do is give you my contact information we obviously hit you with a lot of information then today's session if you have any further questions feel free to email me at Travis B at Apple comm this extends for both printing and any of the 2d graphic technologies there in Mac OS