graphicsContexts = CFArrayCreate( NULL, (const void **)
&contextType, 1,
&kCFTypeArrayCallBacks );
stErr = PMSessionSetDocumentFormatGeneration( printSession,
kPMDocumentFormatDefault, graphicsContexts, NULL );
stErr = PMSessionBeginDocument( printSession, printSettings,
pageFormat );
stErr = PMSessionBeginPage( printSession, pageFormat, NULL );
stErr = PMSessionGetGraphicsContext( printSession,
kPMGraphicsContextCoreGraphics,
(void**)&printingContext );
PMRect pageBounds, paperBounds;
PMGetAdjustedPageRect( pageFormat, &pageBounds );
float carbonPageWidth = pageBounds.right - pageBounds.left;
float carbonPageHeight = pageBounds.bottom - pageBounds.top;
PMGetAdjustedPaperRect( pageFormat, &paperBounds );
float carbonPaperWidth = paperBounds.right - paperBounds.left;
float carbonPaperHeight = paperBounds.bottom - paperBounds.top;
CGRect destinationRect;
destinationRect.size.height = carbonPageHeight;
destinationRect.size.width = carbonPageWidth;
destinationRect.origin.x = pageBounds.left;
destinationRect.origin.y = pageBounds.top;
double paperToPageYOffset = carbonPaperHeight +
paperBounds.top - carbonPageHeight;
double xOffset = -paperBounds.left;
CGContextBeginPage( printingContext, &destinationRect );
CGContextTranslateCTM( printingContext, xOffset,
paperToPageYOffset );
CGContextSetShouldAntialias( printingContext, false );
CGContextBeginPath( printingContext );
CGContextMoveToPoint( printingContext, 10, 10 );
CGContextAddLineToPoint( printingContext, 20, 20 );
CGContextStrokePath( printingContext );
CGContextEndPage( printingContext );
stErr = PMSessionEndPage( printSession );
stErr = PMSessionEndDocument( printSession );
stErr = PMSessionError( printSession );
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden