CompuServe Thread

print page size

12 messages in this thread
#30355From: Gary CappsJul 8, 1994 10:41 PM
GR> Can one get the size of the paper in device units (pixels) GR> such that OnPrepareDC can set the viewport extent to be GR> appropriate for the printer paper and not the screen? The following will get the size of the *paper* in logical units (MM_HIENGLISH) which can then be converted to device units via LPtoDP()… // find out the physical page size PRINTDLG pd; CRect rectPaper; if ( AfxGetApp()->GetPrinterDeviceDefaults( &pd ) ) { ASSERT( pd.hDevMode != NULL ); LPDEVMODE ptrDevMode = ( LPDEVMODE )::GlobalLock( pd.hDevMode ); switch( ptrDevMode->dmPaperSize ) { case 0: // the dmPaperWidth & dmPaperLength are the width & height of // a custom paper size expressed in 1/10's of a millimeter. // convert to inches in MM_HIGHENGLISH… rectPaper = CRect( 0, 0, ptrDevMode->dmPaperWidth * 4, -ptrDevMode->dmPaperLength * 4 ); break; case DMPAPER_LETTER: case DMPAPER_LETTERSMALL: case DMPAPER_NOTE: rectPaper = (ptrDevMode->dmOrientation == DMORIENT_LANDSCAPE ? CRect( 0, 0, 11000, -8500 ) : CRect( 0, 0, 8500, -11000 )); // 8-1/2 x 11 break; case DMPAPER_LEGAL: rectPaper = ( ptrDevMode->dmOrientation == DMORIENT_LANDSCAPE ? CRect( 0, 0, 14000, -8500 ) : CRect( 0, 0, 8500, -14000 )); // 8-1/2 x 14 break; default: rectPaper = CRect( 0, 0, 0, 0 ); // handle other sizes, if needed break; } ::GlobalUnlock( pd.hDevMode ); For some printers, the size of the paper and the size of the "display" (maximum printable area) will be the same (the WinFAX driver, for example, is like this). However others have a "hard clip" limit where tohe printer physically cannot print. The printable area of the page can be obtained like this… CPoint sizePrintableArea; sizePrintableArea.x = m_pDC->GetDeviceCaps( HORZRES ); sizePrintableArea.y = m_pDC->GetDeviceCaps( VERTRES ); pDC->DPtoLP( &sizePrintableArea ); Hope this helps. gc Norman, Oklahoma USA — "Is that a *real* poncho or is that a *Sears* poncho?"
#30391From: Charles SteinhardtJul 9, 1994 9:00 PM
>> — "Is that a *real* poncho or is that a *Sears* poncho?" << Perhaps if you pass Zircon Encrusted Tweezers, we could pontificate this subject. <g> Charles Steinhardt[MVP], OMG Inc. Written 09-Jul-1994 @ 21:44:34 Windows NavCIS PRO 1.21 !^NavFont01F000DMGJHGyMG{HG7D36F5
#30406From: Michael Meadows [MVP]Jul 10, 1994 8:19 AM
Charles, >>> — "Is that a *real* poncho or is that a *Sears* poncho?" << > >Perhaps if you pass Zircon Encrusted Tweezers, we could pontificate this >subject. <g> Well, I've heard of DeadHeads but what do we call you guys? Probably the Yellow Snow People. <g> Michael Meadows
#30416From: Charles SteinhardtJul 10, 1994 12:57 PM
>> but what do we call you guys? Probably the Yellow Snow People. <g> << How 'bout the Sons & Daughters of Florentine Pogens! …. <g> Charles Steinhardt[MVP], OMG Inc. Written 10-Jul-1994 @ 13:56:11 Windows NavCIS PRO 1.21 !^NavFont01F000FMGJHG39MG3BHG6EC665
#30421From: Michael Meadows [MVP]Jul 10, 1994 3:29 PM
Charles, >How 'bout the Sons & Daughters of Florentine Pogens! …. <g> LOL. Sounds good…I'll ask Susy Creamcheese what she thinks. <g> Michael Meadows
#30436From: Charles SteinhardtJul 10, 1994 7:30 PM
>> Susy Creamcheese << ROTF Ahh.. suzy .. that inimitable dwarf crushing wench! Probably munching on an Uncle meat sandwich! Ohh.. this brings back my psychedelic college (or should I have said collage?) days. Charles Steinhardt[MVP], OMG Inc. Written 10-Jul-1994 @ 20:28:10 Windows NavCIS PRO 1.21 !^NavFont01F000DMGJHGYMG_HGB115B1
#30503From: Michael Meadows [MVP]Jul 11, 1994 9:38 AM
Charles, >Ahh.. suzy .. that inimitable dwarf crushing wench! Probably munching on an >Uncle meat sandwich! Ohh.. this brings back my psychedelic college (or >should I have said collage?) days. It's always nice to find a kindred spirit! Michael Meadows
#30533From: Charles SteinhardtJul 11, 1994 1:31 PM
"I knew you'd be surprised" – Bobby Brown/Sheik Ur B.. album Yes, I knew you has a good perspective and sense of humour in your messages. Congrats on the Annual award in SDK!! Charles Steinhardt[MVP], OMG Inc. Written 11-Jul-1994 @ 14:18:23 Windows NavCIS PRO 1.21 !^NavFont01F0007MGHHG90F7FD
#30557From: Michael Meadows [MVP]Jul 11, 1994 4:31 PM
Charles, >Congrats on the Annual award in SDK!! Thanks…and congrats to you! I have no doubt that you will be on the first Annual list for this forum. (Shall we form a mutual admiration society? You pat my back and I'll pay yours. <g>) Michael Meadows
#30602From: Charles SteinhardtJul 11, 1994 9:29 PM
>> You pat my back and I'll pay yours. << Yeah.. that's the ticket… Morgan.. uh.. yeah.. Morgan Fairchild.. she's a big fan and voted us .. yeah and Bil..Uh Bill Gates personally is watching.. yeah ..he's gonna award us hi flat screen technology contract… BTW, Do you havce the book Undocumented WIndows (Matt Pietrak, et.al.)? Charles Steinhardt[MVP], OMG Inc. Written 11-Jul-1994 @ 22:25:47 Windows NavCIS PRO 1.21 !^NavFont01F000CMGJHGfMGhHH\2E7E
#30661From: Michael Meadows [MVP]Jul 12, 1994 9:28 AM
Charles, >yeah and Bil..Uh Bill Gates personally is watching.. Oh yes, he's not only watching…he speaks to me personally through a filling in my tooth. >BTW, Do you havce the book Undocumented WIndows (Matt Pietrak, et.al.)? No…why do you ask? Michael Meadows
#30412From: Gary CappsJul 10, 1994 11:26 AM
CS> Perhaps if you pass Zircon Encrusted Tweezers, CS> we could pontificate this subject. <g> Yippie-eye-oh-tye-ay, pardner 😉 gc The dental floss tycoon of Norman, Oklahoma USA — "Is that a *real* poncho or is that a *Sears* poncho?"