Problem with printing portrait and landscape

General TRichView support forum. Please post your questions here
Post Reply
georgeggc
Posts: 1
Joined: Thu May 08, 2008 8:25 am

Problem with printing portrait and landscape

Post by georgeggc »

Hi,
I need to print some page in portrait and same in landscape. I use 2 richviewedit, one is load with document that will be print in postrait orientation and one with the document that will be print in landscape orientation. The exemple from http://www.trichview.com/forums/viewtopic.php?t=87
doesn't work. I try to print one document and then the second document (the content of richviewedit but doesn't work).
Please help me!
void __fastcall TForm1::Button3Click(TObject *Sender)
{
TPrinter *prt= new TPrinter;

PrintDialog1->Execute();
{
prt->Orientation=poPortrait;
prt->BeginDoc();
RVPrint1->AssignSource(re) ;
RVPrint1->FormatPages(rvdoALL);
RVPrint1->Print("Titlu",1,false);
prt->EndDoc();
prt->Orientation=poLandscape;
prt->BeginDoc();
RVPrint1->AssignSource(rv1);
RVPrint1->FormatPages(rvdoALL);
RVPrint1->Print("Titlu",1,false);
prt->EndDoc();
}
}
the second document rv1 is printing in portrait mode.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do not create a new TPrinter object.
Instead of

Code: Select all

TPrinter *prt= new TPrinter;
use

Code: Select all

TPrinter *prt= Printer();
Post Reply