I want to place an inches boarder on my print preview so end users can get an idea of what the out put will look like.
Is there a way to do that?
Printable View
I want to place an inches boarder on my print preview so end users can get an idea of what the out put will look like.
Is there a way to do that?
Hey dude .. am not sure about inches..but can be
VERTSIZE -> Vertical size in millimetersCode:pDC->GetDeviceCaps(VERTSIZE )
look at this link,
Lineprinter COM class
where they have used
just check it up.Code:// obtain the page dimensions from the Device Context
m_page_height = dc.GetDeviceCaps(VERTSIZE) * MM_TO_INCH;
m_page_width = dc.GetDeviceCaps(HORZSIZE) * MM_TO_INCH;
if a post helps , dont forget to "Rate this post"
Guess the above one will cause nothing good !!
hope this helps.. this is just a sample .. just to give u some idea
Code:int m_LeftMargin, m_PageWidth ,m_RightMargin;
// u got to fix up the value of margin !!
CRect &outRect;
outRect.left = m_LeftMargin;
outRect.right = m_PageWidth - m_RightMargin;
its like this : in the function !!
Code:]
int inTabStop;
CRect &outRect;
outRect.top = m_DataTop;
outRect.bottom = outRect.top + m_TextSizes[eDataFont].cy;
if( inTabStop <= 0 )
{
// rectangle extends from the left edge upto the first tab stop
outRect.left = m_LeftMargin;
outRect.right = m_TabStops[1];
return;
}
// If inTab is after the last valid tab, trim it to be within the right margin.
if( inTabStop > m_TabStops.GetSize()-1)
{
// inTabStop = m_TabStops.GetSize()-1;
// set to the last tab
outRect.left = m_TabStops[ m_TabStops.GetSize() - 2 ];
outRect.right = m_PageWidth - m_RightMargin;
return;
}
outRect.left = m_TabStops[inTabStop];
outRect.right = m_TabStops[inTabStop+1];
If you're not doing it already, you should derive your own print preview object from CPreviewView. You can then handle any extra drawing yourself.
You can use the GetDeviceCaps function on the CDC of the printer in your OnPrint function. You can query the number of pixels per inch and from that indent the CPrintINfo::m_rectDraw member by the required amount to simulate your border. How you render the output after that is up to you.