Bug 274 - POW, printer margins on Win32


Subject: Bug 274 - POW, printer margins on Win32
From: Mike Nordell (tamlin@algonet.se)
Date: Sat May 06 2000 - 14:43:19 CDT


Not having access to a decent printer I can't verify the provided
solution. Somewone using Win32 that can check if it works?

af/gr/win/gr_Win32Graphics.cpp

@@ -322,7 +322,16 @@
        UT_ASSERT(m_bPrint);
        UT_ASSERT(!m_bStartPrint);
        m_bStartPrint = ( StartDoc(m_hdc,m_pDocInfo) > 0 );
-
+
+ // PHYSICALOFFSETX returns offset of printable area from the left
edge
+ // of the physical printer paper. The value returned is in device
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_bStartPrint;
 }

@@ -333,6 +342,7 @@
                EndPage(m_hdc);

        m_bStartPage = UT_TRUE;
+
        return (StartPage(m_hdc) > 0);
 }



This archive was generated by hypermail 2b25 : Sat May 06 2000 - 13:44:26 CDT