|
-
November 10th, 2005, 06:59 AM
#1
PrintPreview. Inches border
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?
-
November 10th, 2005, 07:25 AM
#2
Re: PrintPreview. Inches border
Hey dude .. am not sure about inches..but can be
Code:
pDC->GetDeviceCaps(VERTSIZE )
VERTSIZE -> Vertical size in millimeters
look at this link,
Lineprinter COM class
where they have used
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;
just check it up.
if a post helps , dont forget to "Rate this post"
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
November 10th, 2005, 08:00 AM
#3
Re: PrintPreview. Inches border
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];
Last edited by jayender.vs; November 10th, 2005 at 08:02 AM.
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
November 10th, 2005, 09:18 AM
#4
Re: PrintPreview. Inches border
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.
Gort...Klaatu, Barada Nikto!
-
November 13th, 2005, 02:58 PM
#5
Re: PrintPreview. Inches border
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.
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|