🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2316

SUMMARY: Width of print border

#2316
From: Joachim Hagger
Date: Mon, 25 Jan 1993 13:52
32 lines
1642 bytes
The original question was:
> How can I determine the non-printing border offset added to my documents?

The only answer I got was the right solution:
twbrown@PE-Nelson.COM (Tom W. Brown) answered:

The following function will give you the pixel offset from the top left
corner of the page for the first printable pixel (i.e. the pixel based
size of the left and top border):

   POINT ptOffset;
   Escape(hdc, GETPRINTINGOFFSET, NULL, NULL, &ptOffset);

Now, the next call(s) will give you the printable area ot the page in pixels:

   POINT ptPrintable;
   ptPrintable.x = GetDeviceCaps(hdc, HORZRES);
   ptPrintable.y = GetDeviceCaps(hdc, VERTRES);

And finally, this function gives you the total, physical page size (still
in pixels);

   POINT ptPhysical;
   Escape(hdc, GETPHYSICALPAGESIZE, NULL, NULL, &ptPhysical);

So, ptOffset gives you the left and top border directly. The right and
bottom borders can be found by simply subtracting the corresponding left
and top border along with the printable width and height from the
physical width and height of the page.

All unit are in pixels -- you can convert to whatever units you need.
Technical Details
Message-ID: <1993Jan25.135214.14380@rzu-news.unizh.ch>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!scsing.switch.ch!rzusuntk.unizh.ch!hagger

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!scsing.switch.ch!rzusuntk.unizh.ch!hagger
From: hagger@rsl.geogr.unizh.ch (Joachim Hagger)
Subject: SUMMARY: Width of print border
Message-ID: <1993Jan25.135214.14380@rzu-news.unizh.ch>
Sender: root@rzu-news.unizh.ch (Operator)
Organization: Remote Sensing Laboratories, University of Zurich
Date: Mon, 25 Jan 1993 13:52:14 GMT
Lines: 32