I am facing the following problems in drawing text and graphics in CGContextRef of an NSview and Printing framework:
1) drawing text using: [finalString drawInRect:textBox withAttributes:attributes]; Works nicely in my sub-classed NSViews in a CGContextRef obtained in the drawRect : method with CGContextRef viewCtx= [[NSGraphicsContext currentContext] CGContext]; But draws nothing in a print context obtained PMSessionGetCGGraphicsContext(printSession, &ctx); //( geometry is perfectly previewed,Pdf’ed and printed except texts .. ) 2) filling a bezier path with a pattern Color NSImage* nsPatImage= [[NSImage alloc] initWithCGImage:cgPatImage size:NSZeroSize]; NSColor* patternColor= [NSColor colorWithPatternImage:nsPatImage]; [patternColor setFill]; [bezierPath fill]; Works like a charm in the graphic context of NSView and print nothing in a print context. I suspect this has something to do with the notion of « Current context » , as the context in NSView is explicitly the « currentContext » But not sure if the printing context is the « current one » in the usual print sequence ; err= PMSessionBeginPageNoDialog(printSession, format ) ctx = PMSessionGetCGGraphicsContext(printSession, &ctx) [myDrawMethode: ctx] // [finalString drawInRect:textBox withAttributes:attributes]; draws nothing in the printing context PMSessionEndPageNoDialog(printSession); I would appreciate any advice or suggestion regarding these points King regards JP _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com