Re: Printing examples in Cocoa
Re: Printing examples in Cocoa
- Subject: Re: Printing examples in Cocoa
- From: matt neuburg <email@hidden>
- Date: Tue, 17 Dec 2002 12:05:34 -0800
On Mon, 16 Dec 2002 22:14:44 +0100, "Frans H. Schippers" <email@hidden> said:
>
Can some one point me to some examples of printing with cocoa.
>
I want to print several fields and tables on paper, but don't know
>
how to do it. If some could point to some sample code.
Look at TextEdit (it's on your computer). Printing is done in the MultiplePageView class.
Basically printing is simple - it's just drawing. You have, or make, a view and hand it to your print job; whatever the view draws is printed. If the view contains interface-type items, they will print. If the view draws stuff with drawRect, it will print. In short the view is copied to paper just as if it lived in a window (in fact, it can BE a view in a window, and learning to print by practicing with a view that is in a window is a good way to get started).
The only complicated issue is pagination. I suggest you avoid that issue on your first go and just concentrate on printing a single view. Then you can come back to it. Pagination is very neatly implemented in Cocoa: basically there are two ways to do it, each with its own uses. But before you get to that, you just need to print something, anything, to see how easy it really is. m.
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.