Printer Orientation after LoadRTF

General TRichView support forum. Please post your questions here
Post Reply
AXSchmidt
Posts: 20
Joined: Thu Mar 15, 2012 3:16 pm

Printer Orientation after LoadRTF

Post by AXSchmidt »

Is it possible to get the orientation after LoadRTF?

Code: Select all

      RichVReportHelper.RichView.LoadRTF(filename);
      Printer.Orientation := RichVReportHelper.RichView.DocParameters.Orientation;
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Make sure that RichVReportHelper.RichView.RTFReadProperties.ReadDocParameters = True
AXSchmidt
Posts: 20
Joined: Thu Mar 15, 2012 3:16 pm

Post by AXSchmidt »

yes, im sure...

in your demo
\Demos\Delphi\Assorted\Printing\Headers
the orientation is not adopted, too
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Well, it's tricky.
Actually, DocParameters.Orientation = poLandscape means only that DocParameters.Width and Height must be exchanged.
The actual orientation is determined by a comparison of Width and Height.

Code: Select all

if rv.DocParameters.Width>rv.DocParameters.Height then
  if rv.DocParameters.Orientation=poPortrait then
    Printer.Orientation := poLandscape
  else
    Printer.Orientation := poPortrait
else
    Printer.Orientation := rv.DocParameters.Orientation;
AXSchmidt
Posts: 20
Joined: Thu Mar 15, 2012 3:16 pm

Post by AXSchmidt »

Thks!

It work's 8)

But i think you mean:

Code: Select all

if rv.Width>rv.Height then 
cause rv.docparameters dont have width & height!? :?
AXSchmidt
Posts: 20
Joined: Thu Mar 15, 2012 3:16 pm

Post by AXSchmidt »

pleased too early

I've

Code: Select all

      RVRHMain.RichView.RTFReadProperties.ReadDocParameters := True;

      RVRHMain.RichView.LoadRTF(dateiname);

      if RVRHMain.RichView.Width > RVRHMain.RichView.Height then
      begin
        if RVRHMain.RichView.DocParameters.Orientation = poPortrait then
          Printer.Orientation := poLandscape
        else
          Printer.Orientation := poPortrait;
      end else
        Printer.Orientation := RVRHMain.RichView.DocParameters.Orientation;
and my Printer Orientation is always Landscape...
AXSchmidt
Posts: 20
Joined: Thu Mar 15, 2012 3:16 pm

Post by AXSchmidt »

Problem solved

Code: Select all

if RVRHMain.RichView.DocParameters.PageWidth > RVRHMain.RichView.DocParameters.PageHeight then
instead of

Code: Select all

if RVRHMain.RichView.Width > RVRHMain.RichView.Height then
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Yes, sorry for this mistake.
Post Reply