- err = PMBeginPage(m_macPrintPort, nil);
- if ( err )
- {
- message.Printf( "Print Error %d", err ) ;
- wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
- PMEndPage(m_macPrintPort);
- PMEndDocument(m_macPrintPort);
- UMAPrClose() ;
- ::SetPort( macPrintFormerPort ) ;
- m_ok = FALSE ;
- }
+ #if PM_USE_SESSION_APIS
+ err = PMSessionBeginPage((PMPrintSession)m_macPrintSessionPort,
+ (PMPageFormat)m_printData.m_macPageFormat,
+ nil);
+ #else
+ err = PMBeginPage(m_macPrintSessionPort, nil);
+ #endif
+ if ( err != noErr )
+ {
+ message.Printf( "Print Error %ld", err ) ;
+ wxMessageDialog dialog( NULL , message , "", wxICON_HAND | wxOK) ;
+ dialog.ShowModal();
+ #if PM_USE_SESSION_APIS
+ PMSessionEndPage((PMPrintSession)m_macPrintSessionPort);
+ PMSessionEndDocument((PMPrintSession)m_macPrintSessionPort);
+ UMAPrClose(&m_macPrintSessionPort) ;
+ #else
+ PMEndPage(m_macPrintSessionPort);
+ PMEndDocument(m_macPrintSessionPort);
+ UMAPrClose(NULL) ;
+ #endif
+ ::SetPort( macPrintFormerPort ) ;
+ m_ok = FALSE ;
+ }