P:\diffutils-2.7\Debug>diff -u -d -w \AbiWordOrig\abi-0.7.9\src\af\gr\win\gr_Win 32Graphics.cpp \AbiWord\abi-0.7.9\src\af\gr\win\gr_Win32Graphics.cpp --- \AbiWordOrig\abi-0.7.9\src\af\gr\win\gr_Win32Graphics.cpp Wed Apr 19 19:52 :18 2000 +++ \AbiWord\abi-0.7.9\src\af\gr\win\gr_Win32Graphics.cpp Sun May 07 03:30 :24 2000 @@ -330,10 +330,27 @@ UT_Bool bPortrait, UT_uint32 iWidth, UT_uint32 iHeight) { if (m_bStartPage) + { EndPage(m_hdc); + } - m_bStartPage = UT_TRUE; - return (StartPage(m_hdc) > 0); + const int iRet = StartPage(m_hdc); + + m_bStartPage = iRet > 0; + + if (iRet > 0) + { + // PHYSICALOFFSETX returns offset of printable area from the lef t edge + // of the physical printer paper. The value returned is in devic e units. + // Since the current mapping mode is MM_TEXT, this code _should_ work. + const POINT ptNew = { + GetDeviceCaps(m_hdc, -PHYSICALOFFSETX), + GetDeviceCaps(m_hdc, -PHYSICALOFFSETY) + }; + SetViewportOrgEx(m_hdc, ptNew.x, ptNew.y, 0); + } + + return m_bStartPage; } UT_Bool GR_Win32Graphics::endPrint(void)