|
How can I send an escape sequence to the printer?
I'm working with the C++ Builder and the VCL is not supporting escape sequences.
So I tried these snippet
char Help[1024];
sprintf(Help, "\x00c"); // escape sequnce for form feed
Escape(printer->Canvas->Handle,
PASSTHROUGH,
sizeof(Help),
Help,
NULL);
But the printer is not doing anything.
Thanks for your help!
|
|
|
|
|
hi all,
I am trying to get the output of the RTF control using the Device context using the Print method of the CWnd class .It is working fine with Screen Dc and showing the required output but when i am trying to get the output on the Printer by writing on the Device Context of the printer the output is not turning up on the Paper...
The code is just working fine it i write directly to the Printer Device using the FormatRange Structure But there is makes the Screen and Printer output differ a lot.
i hope someone can provide me with a solution for getting the Output of the RTF control on the screen and the printer in a similar fashion..
I am wrting the code that i am using to Write at the Passed DC as parameter.
void CRenderedRTF::DrawControl(CDC* pDC)
{
CRect& refRect = m_ptrControlInfo->GetRect();
// save the device context
pDC->SaveDC();
CClientDC dc(this);
pDC->SetMapMode(MM_ANISOTROPIC);
CSize sz(dc.GetDeviceCaps(LOGPIXELSX),
dc.GetDeviceCaps(LOGPIXELSY) );
pDC->SetWindowExt( sz );
sz = CSize( pDC->GetDeviceCaps(LOGPIXELSX),
pDC->GetDeviceCaps(LOGPIXELSY) );
pDC->SetViewportExt( sz );
CPoint oldPoint = pDC->SetWindowOrg(-refRect.left,-refRect.top);
Print(pDC,PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
pDC->SetWindowOrg(oldPoint.x,oldPoint.y);
// restore the device context
pDC->RestoreDC(-1);
}
The code tends to write at the Screen but fails to show the output on paper.
any help or comment is most welcome..
Sajal
|
|
|
|
|
CDC dc;
CRect page;
FORMATRANGE fmtRange;
long lLineWidth;
int last = 0;
CPrintDialog printDlg(FALSE);
//dlg.GetDefaults();//if we do not want we can use defult printer
if (printDlg.DoModal() == IDCANCEL) // Get printer settings from user
return;
dc.Attach(printDlg.GetPrinterDC()); // Get and attach a printer DC
dc.m_bPrinting = TRUE;
//
DOCINFO di; // Initialise print document details
::ZeroMemory (&di, sizeof (DOCINFO));
di.cbSize = sizeof (DOCINFO);
di.lpszDocName = "BUYHOUSE";
BOOL bPrintingOK = dc.StartDoc(&di); // Begin a new print job
// pInfo->SetMaxPage(0);
// get the page size in twips (1440 twips/inch)
page.left = 0;
page.top = 0;
page.right = ::MulDiv(dc.GetDeviceCaps(PHYSICALWIDTH),
1440, dc.GetDeviceCaps(LOGPIXELSX));
page.bottom = ::MulDiv(dc.GetDeviceCaps(PHYSICALHEIGHT),
1440, dc.GetDeviceCaps(LOGPIXELSY));
lLineWidth = ::MulDiv(dc.GetDeviceCaps(PHYSICALWIDTH),
1440, dc.GetDeviceCaps(LOGPIXELSX))
-dc.GetDeviceCaps(LOGPIXELSX);
CRect rect;//print rectange area
rect.top=dc.GetDeviceCaps(LOGPIXELSY)/2;
rect.bottom=page.bottom-dc.GetDeviceCaps(LOGPIXELSY);
rect.left=dc.GetDeviceCaps(LOGPIXELSX)/2;
rect.right=page.right-dc.GetDeviceCaps(LOGPIXELSX)/2;
// setup the format range attributes
fmtRange.hdc = dc.m_hDC;
fmtRange.hdcTarget = dc.m_hAttribDC;
fmtRange.rc = rect;
fmtRange.rcPage = page;
// determine the correct output for this page
// m_display_ctr.SetTargetDevice(dc, lLineWidth);
while (last < m_display_ctr.GetTextLength())
{
dc.StartPage();
fmtRange.chrg.cpMin = last;
fmtRange.chrg.cpMax = -1;
// measure the data that goes on this page if false
last = m_display_ctr.FormatRange(&fmtRange, TRUE);
fmtRange.chrg.cpMax = last;
m_display_ctr.DisplayBand(&rect);
dc.EndPage();
// pInfo->SetMaxPage(pInfo->GetMaxPage() + 1);//here is used for DOC view
}
m_display_ctr.FormatRange(NULL, FALSE);
if (bPrintingOK)
dc.EndDoc(); // end a print job
else
dc.AbortDoc();
// release the cached DC information stored in SetTargetDevice
dc.DeleteDC();
|
|
|
|
|
did not work for me, the while loop never quits sending 1000s of pages to printer
fixed by:
1) using m_display_ctr.GetTextLengthEx(GTL_PRECISE); in the while loop
2) m_display_ctr.FormatRange(NULL, FALSE); must be included in the while loop
now you have:
// determine the correct output for this page
while (last < m_display_ctr.GetTextLengthEx(GTL_PRECISE))
{
dc.StartPage();
fmtRange.chrg.cpMin = last;
fmtRange.chrg.cpMax = -1;
// measure the data that goes on this page if false
last = m_display_ctr.FormatRange(&fmtRange, TRUE);
fmtRange.chrg.cpMax = last;
m_display_ctr.DisplayBand(&rect);
dc.EndPage();
m_display_ctr.FormatRange(NULL, FALSE);
}
hope this helps.
|
|
|
|
|
how to print since a richText ?
|
|
|
|
|
How can I set all the text-colors to black when printing?
Looking for a good game?
Do it yourself.
GLBasic.com - you can do!
|
|
|
|
|
I have been working on this a while and to me it seems that none of this is need when the control is properly initialized using the two functions below (that are also copied from codeguru, RichEditGS sample) in OnInitialUpdate.
Anyone Agrees? All I did was call these two functions and leave ALL printing stuff unchanged from the defaults.
void CMyView::SetFontSize(int nPointSize)
{ CHARFORMAT cf;
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_SIZE;
GetRichEditCtrl().GetSelectionCharFormat(cf);
nPointSize *= 20; // convert from points to twips
cf.yHeight = nPointSize;
cf.dwMask = CFM_SIZE;
GetRichEditCtrl().SetSelectionCharFormat(cf);
}
void CMyView::SetFontName(const CString strFontName)
{ CHARFORMAT cf;
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_FACE;
GetRichEditCtrl().GetSelectionCharFormat(cf);
CString strName = strFontName.Left(31);
for (int i = 0; i <= strName.GetLength()-1; i++)
cf.szFaceName[i] = (char)(strName[i]);
cf.szFaceName[i]='\0';
cf.dwMask = CFM_FACE;
GetRichEditCtrl().SetSelectionCharFormat(cf);
}
|
|
|
|
|
Hm, I don't know exactly what you want to say. What is not needed?
As I see, you are using the CRichEditView class (?). I think CRichEditView does very much of the printing internally (including the correct stuff for the preview). CRichEditView can be seen as a wrapper for the CRichEditCtrl.
But I think the main problem in this article is that we (and I ) want to use only the CRichEditCtrl, e.g. in a dialog or in a CFormView. And the printing support of CRichEditCtrl is very limited.
|
|
|
|
|
After reading this article I made some investigations regarding the ugly print preview. In the implementation of the CRichEditView from Microsoft I found the solution.
The "trick" seems to be to scale the window extends correctly, before you do the output.
<br />
if (::GetDeviceCaps(pDC->m_hDC, TECHNOLOGY) != DT_METAFILE && pDC->m_hAttribDC != NULL)<br />
{<br />
::ScaleWindowExtEx(pDC->m_hDC,<br />
::GetDeviceCaps(pDC->m_hDC, LOGPIXELSX),<br />
::GetDeviceCaps(pDC->m_hAttribDC, LOGPIXELSX),<br />
::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY),<br />
::GetDeviceCaps(pDC->m_hAttribDC, LOGPIXELSY), NULL);<br />
}<br />
Add this code before you do the printing. I inserted it at the beginning of the OnPrint method. Maybe there is a better place in a CView method during the pre-print phase.
With this code the print preview looks correct in my application. I hope soemone can add comments how it works in other applications, but I think it should work.
If it works the author should add this to the article example code
|
|
|
|
|
I started to take a look at the possibilities on how to print the contents of a CRichtEditCtrl some days ago. I quickly recognized that the MS implementation of the CRichtEditCtrl printing support sucks.
Only some basic, and in my opinion mostly useless features if you develope a complex software. Not mentioned the laughable print preview.
After those shocking experiences I began to take a look at the MSDN Wordpad example and the implementation of the CRichEditView class.
Now I think that the source of many questions about printing an RTF control is in MS' implementation of the CRichEditView class. The source code is in the file VIEWRICH.CPP in the Visual Studio installation directory.
The printing implementation looks very interesting, but I am still at the beginning so I can not post any results yet.
Roger, thank you for your great work and this example
|
|
|
|
|
Hello,
I'm having trouble while printing more than one page. The first page prints correctly.
However, the second page prints its output plus the output of the first page on top.
The only changes i have from your origional code is that i use OnBeginPrinting instead of OnPreparePrinting because OnBeginPrinting already provides me with the CDC.
Thank You in Advance and Thank you for the article...
|
|
|
|
|
Nevermid,
I should have read the post "Beer" made it solves the problem nicely.
Thank you all.
|
|
|
|
|
hey,
if you paste a list of sequential numbers up to say 50
1 on each line
like so
1
2
3
4
5...
You will quicly see that when this project prints out page 2, page 1's numbers are still on the bottom. Is there any way to clear the DC? So that page 2's remaining space is white?
hey
|
|
|
|
|
here's the fix for that
find this in the OnPrint Function
for (UINT i = 0 ; i < pInfo->m_nCurPage ; i++)
{
fmtRange.chrg.cpMin = last;
fmtRange.chrg.cpMax = -1;
// measure the data that goes on this page
last = m_Control.FormatRange(&fmtRange, TRUE); // just measuring, not displaying
fmtRange.chrg.cpMax = last;
// when we drop out of the loop, we should print the correct part of the output for the current page
}
and replace it with this
for (UINT i = 0 ; i < pInfo->m_nCurPage ; i++)
{
fmtRange.chrg.cpMin = last;
fmtRange.chrg.cpMax = -1;
// measure the data that goes on this page
if (i < pInfo->m_nCurPage-1) {
last = m_Control.FormatRange(&fmtRange, FALSE); m_Control.FormatRange(NULL, FALSE); }
else { last = m_Control.FormatRange(&fmtRange, TRUE); }
fmtRange.chrg.cpMax = last;
// when we drop out of the loop, we should print the correct part of the output for the current page
}
That will make sure that multiple pages will not overlap on any whitespace on the last page
hey
|
|
|
|
|
is it Posible to Print richtext with in a given rectangle area
don't worry with the size of file..
is a simple thing i expliend in lot..
Trying: Edit,RichEdit control printing,
with in a rectangle as per they are drawn
in scroll view..
----
//****************************************************************************
// I want to draw the RichTextControl content in a specified rectangle on my printing page
// (as i done with editbox control) using FormatRange function with the different
// Font styles as in RichEditControl - HelpMe please!.
// DrawRichText(CDC *pDC) -> could u solve the problem that i have in this function ?..
//***********************************************************************
//RTCtrlPrint1View.h
public:
CRTCtrlPrint1Doc* GetDocument();
//My*************************************
void RTCtrlCreate();
void DrawRichText(CDC *pDC);
void DrawEditText(CDC *pDC);
CRichEditCtrl m_redit;
CRect m_redRect;
CEdit m_edit;
CRect m_edRect;
UINT r;
CFont font;
//***************************************
//RTCtrlPrint1View.cpp
//=======================
void CRTCtrlPrint1View::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
//edith box displaytext font
font.CreateFont(14,0,0,0,FW_NORMAL,FALSE,FALSE,
0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
DEFAULT_PITCH|FF_MODERN,"Arial");
r=14;
m_edRect = CRect(50*r,-100*r,240*r,-700*r);
m_redRect = CRect(250*r,-100*r,750*r,-700*r);
CSize sizeTotal;
sizeTotal.cx = 850*r;
sizeTotal.cy = 1100*r;
SetScrollSizes(MM_TWIPS, sizeTotal); //MM_TWIPS
RTCtrlCreate();
}
void CRTCtrlPrint1View::OnDraw(CDC* pDC)
{
CRTCtrlPrint1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDC->Rectangle(1*r,1*r,800*r,-1100*r);//Print Area Rect
if(pDC->IsPrinting())
{
DrawEditText(pDC);//Simple Edit box text
DrawRichText(pDC);//My RichEdit box text
}
}
#define IDC_REDIT 4001 //defining a resource ID
#define IDC_EDIT 4002 //defining a resource ID
void CRTCtrlPrint1View::RTCtrlCreate() //creates both Rich edit & Edit Controls
{
CRect m_temp;
CClientDC dc(this);
OnPrepareDC(&dc);
//creating edit box in scroll view
m_temp = m_edRect;
dc.LPtoDP(m_temp);
m_edit.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE,m_temp,this,IDC_EDIT);
m_edit.SetFont(&font,FALSE);
m_edit.SetWindowText("Help Me! Thank u");
//creating rich edit box in scroll view
m_temp = m_redRect;
dc.LPtoDP(m_temp);
m_redit.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE,m_temp,this,IDC_REDIT);
//writing some text in richtext control
CString str;
str="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\froman\\fprq2\\fcharset0 Times New Roman;}{\\f1\\fswiss\\fprq2\\fcharset0 System;}}{\\colortbl ;\\red255\\green0\\blue0;\\red51\\green153\\blue102;\\red0\\green0\\blue255;}\\viewkind4\\uc1\\pard\\cf1\\i\\f0\\fs24 ThankYou\
\\cf0\\i0 \\cf2\\b for\
\\cf0\\b0 \\cf3 Trying\
\\cf0 !\\b\\f1\\fs20 \\par }";
EDITSTREAM es;
es.dwCookie = (DWORD)&str;
es.pfnCallback = RichEditStreamInCallback;
m_redit.StreamIn(SF_RTF,es);
}
void CRTCtrlPrint1View::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CScrollView::OnPrepareDC(pDC, pInfo);
// pDC->SetMapMode(MM_ANISOTROPIC);
pDC->SetMapMode(MM_TWIPS);
}
void CRTCtrlPrint1View::DrawEditText(CDC *pDC)
{
CRect m_temp;
m_temp = m_edRect;
CString str;
m_edit.GetWindowText(str);
pDC->SetBkMode(TRANSPARENT);
pDC->Rectangle(m_temp);
//Draws with Fonts as we wish
pDC->DrawText(str,m_temp,DT_WORDBREAK|DT_EXPANDTABS|DT_NOPREFIX);
}
//****************************************************************************// I want to draw the RichTextControl content in a specified rectangle on my
// printing page (as i done with editbox control) using FormatRange function
// with the different Font styles as in RichEditControl - HelpMe please!.
// DrawRichText(CDC *pDC) -> could u solve the problem that i have in this
// function ?..
//****************************************************************************void CRTCtrlPrint1View::DrawRichText(CDC *pDC)
{
CRect m_temp;
FORMATRANGE fmtRange;
long lLineWidth;
m_temp = m_redRect;
// pDC->LPtoDP(m_temp);
pDC->Rectangle(m_temp);
lLineWidth = ::MulDiv(pDC->GetDeviceCaps(PHYSICALWIDTH), 1440,
pDC->GetDeviceCaps(LOGPIXELSX));
fmtRange.hdc = pDC->m_hDC;
fmtRange.hdcTarget = pDC->m_hDC;
fmtRange.rc = m_temp;
fmtRange.rcPage = m_temp;
fmtRange.chrg.cpMin = 0;
fmtRange.chrg.cpMax = -1;
m_redit.SetTargetDevice(pDC->m_hDC, lLineWidth);
m_redit.FormatRange(&fmtRange, TRUE);
}
Balaji
|
|
|
|
|
is it Posible to Print richtext with in a given rectangle area
don't worry with the size of file..
is a simple thing i expliend in lot..
Trying: Edit,RichEdit control printing,
with in a rectangle as per they are drawn
in scroll view..
----
//***************************************************************************************
// I want to draw the RichTextControl content in a specified rectangle on my printing page
// (as i done with editbox control) using FormatRange function with the different
// Font styles as in RichEditControl - HelpMe please!.
// DrawRichText(CDC *pDC) -> could u solve the problem that i have in this function ?..
//***************************************************************************************
//The partial code
//RTCtrlPrint1View.h
public:
CRTCtrlPrint1Doc* GetDocument();
//My*************************************
void RTCtrlCreate();
void DrawRichText(CDC *pDC);
void DrawEditText(CDC *pDC);
CRichEditCtrl m_redit;
CRect m_redRect;
CEdit m_edit;
CRect m_edRect;
UINT r;
CFont font;
//***************************************
//RTCtrlPrint1View.cpp
//=======================
void CRTCtrlPrint1View::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();
//edith box displaytext font
font.CreateFont(14,0,0,0,FW_NORMAL,FALSE,FALSE,
0,ANSI_CHARSET,OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,
DEFAULT_PITCH|FF_MODERN,"Arial");
r=14;
m_edRect = CRect(50*r,-100*r,240*r,-700*r);
m_redRect = CRect(250*r,-100*r,750*r,-700*r);
CSize sizeTotal;
sizeTotal.cx = 850*r;
sizeTotal.cy = 1100*r;
SetScrollSizes(MM_TWIPS, sizeTotal); //MM_TWIPS
RTCtrlCreate();
}
void CRTCtrlPrint1View::OnDraw(CDC* pDC)
{
CRTCtrlPrint1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDC->Rectangle(1*r,1*r,800*r,-1100*r);//Print Area Rect
if(pDC->IsPrinting())
{
DrawEditText(pDC);//Simple Edit box text
DrawRichText(pDC);//My RichEdit box text
}
}
#define IDC_REDIT 4001 //defining a resource ID
#define IDC_EDIT 4002 //defining a resource ID
void CRTCtrlPrint1View::RTCtrlCreate() //creates both Rich edit & Edit Controls
{
CRect m_temp;
CClientDC dc(this);
OnPrepareDC(&dc);
//creating edit box in scroll view
m_temp = m_edRect;
dc.LPtoDP(m_temp);
m_edit.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE,m_temp,this,IDC_EDIT);
m_edit.SetFont(&font,FALSE);
m_edit.SetWindowText("Help Me! Thank u");
//creating rich edit box in scroll view
m_temp = m_redRect;
dc.LPtoDP(m_temp);
m_redit.Create(WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE,m_temp,this,IDC_REDIT);
//writing some text in richtext control
CString str;
str="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang2057{\\fonttbl{\\f0\froman\\fprq2\\fcharset0 Times New Roman;}{\\f1\\fswiss\\fprq2\\fcharset0 System;}}{\\colortbl ;\\red255\\green0\\blue0;\\red51\\green153\\blue102;\\red0\\green0\\blue255;}\\viewkind4\\uc1\\pard\\cf1\\i\\f0\\fs24 ThankYou\
\\cf0\\i0 \\cf2\\b for\
\\cf0\\b0 \\cf3 Trying\
\\cf0 !\\b\\f1\\fs20 \\par }";
EDITSTREAM es;
es.dwCookie = (DWORD)&str;
es.pfnCallback = RichEditStreamInCallback;
m_redit.StreamIn(SF_RTF,es);
}
void CRTCtrlPrint1View::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo)
{
CScrollView::OnPrepareDC(pDC, pInfo);
// pDC->SetMapMode(MM_ANISOTROPIC);
pDC->SetMapMode(MM_TWIPS);
}
void CRTCtrlPrint1View::DrawEditText(CDC *pDC)
{
CRect m_temp;
m_temp = m_edRect;
CString str;
m_edit.GetWindowText(str);
pDC->SetBkMode(TRANSPARENT);
pDC->Rectangle(m_temp);
//Draws with Fonts as we wish
pDC->DrawText(str,m_temp,DT_WORDBREAK|DT_EXPANDTABS|DT_NOPREFIX);
}
//****************************************************************************// I want to draw the RichTextControl content in a specified rectangle on my
// printing page (as i done with editbox control) using FormatRange function
// with the different Font styles as in RichEditControl - HelpMe please!.
// DrawRichText(CDC *pDC) -> could u solve the problem that i have in this
// function ?..
//****************************************************************************void CRTCtrlPrint1View::DrawRichText(CDC *pDC)
{
CRect m_temp;
FORMATRANGE fmtRange;
long lLineWidth;
m_temp = m_redRect;
// pDC->LPtoDP(m_temp);
pDC->Rectangle(m_temp);
lLineWidth = ::MulDiv(pDC->GetDeviceCaps(PHYSICALWIDTH), 1440,
pDC->GetDeviceCaps(LOGPIXELSX));
fmtRange.hdc = pDC->m_hDC;
fmtRange.hdcTarget = pDC->m_hDC;
fmtRange.rc = m_temp;
fmtRange.rcPage = m_temp;
fmtRange.chrg.cpMin = 0;
fmtRange.chrg.cpMax = -1;
m_redit.SetTargetDevice(pDC->m_hDC, lLineWidth);
m_redit.FormatRange(&fmtRange, TRUE);
}
Balaji
|
|
|
|
|
I am trying to print the background color of the CRichEditControl. It is not working on my
W2K platform so I am filling the area to be printed with a bitmap of the appropriate color. This introduces a new problem on
W2k because now it will not print the text over the bitmap in a TRANSPARENT background mode.
I.E. Calling SetBkMode(TRANSPARENT); has no effect, the text has a white background over the bitmap!
GDI functions like TextOut() work as expected. It is the CRichEditControl's
FormatRange() that seems to be the problem.
|
|
|
|
|
I've the same problem ...
Has someone found a workaround ?
Thx
|
|
|
|
|
I made a copy some text from another application's richedit
control to control of the demo project. When I want to print
,it returns with "Failed to get printer DC" (trace message).
What is missing that I should add to demo project?
Thanks.
|
|
|
|
|
I have seen this problem in the past when either the application or the PC has no default printer setup for it. Having recently switched to XP, it has been much more common. Try selecting the "Print Setup" option first to see if that fixes the problem. If its not a problem with the default printer, you will have to post some code to let me better understand the problem.
Roger Allen
Sonork 100.10016
This is a multiple choice question, choose wisely
Why did the hedgehog cross the road?
A: To show he had guts?
B: To see his flat mate?
|
|
|
|
|
I already have default printer installed. Using w2000.
Nothing changed. Same trace message still.
Thanks.
|
|
|
|
|
i get the same error when using your project.
when i use 'print setup' first and then try to print or print preview, i get a debug assertation error in afxcmn.inl, line 687.
i'm actually trying to modify your code to print docs from a CRichEditView.
|
|
|
|
|
I had the same problem. Unfortunately, the printer I wish to print to may not be the default printer, so as far as I can tell, any computation made on the default printer would be irrelevant (e.g., my default printer is B&W 2400dpi, but the printer I want to print on is color, 1200dpi; and suppose my default printer uses standard paper but I want to use 11x17 in my color printer? Overall, I don't see how this can possibly work by assuming a default printer for the first computation).
Also, I don't get background color, and I can't figure out how to get page headings and footings, and I seem to get multiple copies of the same page instead of multiple pages.
|
|
|
|
|
The problem goes away when you use OnBeginPrinting instead of OnPreparePrinting, since there you'll get the DC passed in. Just replace "dc." by "pDC->" and remove the printer DC creation.
|
|
|
|
|
...im having the same problems! Actually, i've managed to have a good print preview of it; using a normal CDC::DrawText with font size 12, had the size as the RTF. The problem was on printing! I had to resize the entire output to match the printer (MM_ISOTROPIC) and everything works well except the RTF, which increased several times! I think it may have something to do with output DPI (dots per inch), although im setting the device target.
I came to a point where i dont know if im doing the right preview with the wrong printing or exactly the opposite!
Ill be happy to work on some sollution.
|
|
|
|
|