> Is CGContextRef and CGrafPtr are the same??
No. Look at QDBegin/EndCGContext
meeroh

Signature
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>
> Is CGContextRef and CGrafPtr are the same?? I do found that in
> PMSessionGetGraphicsContext API. If i am deriving a printer context,
> can
> I use setport to set the drawing port to this port??
They are not the same. The full story is here:
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingMana
ger_Ref/cpmref_reference/function_group_6.html#//apple_ref/doc/c_ref/PMSessi
onSetDocumentFormatGeneration
<<<<<
On return, a reference to the current graphics context. The graphics context
returned is the one last set by a call to the function
PMSessionSetDocumentFormatGeneration or the default (QuickDraw) if there was
no call to the function. This reference must be typecast to an appropriate
structure (such as a grafPtr) by the caller.
You should call this function for each page you draw for a print job. After
each call to the function PMSessionBeginPage your application should call
PMSessionGetGraphicsContext to obtain the current graphics context. If that
context is a QuickDraw context, then set the drawing port to this port by
calling the QuickDraw SetPort function. See the discussion of the function
PMSessionBeginPage for more information.
In Mac OS 8 and 9 applications are limited to a QuickDraw context, so
PMSessionGetGraphicsContext returns a grafPtr. In Mac OS X, the graphics
context returned to you is the one last set by a call to the function
PMSessionSetDocumentFormatGeneration.

Signature
Mike Kluev
PS. Remove "-DELETE-." part of my e-mail address to reply.