Page 1 of 1

RichViewEdit - margin - printout

Posted: Fri Nov 17, 2006 2:07 pm
by Crowbar
Hi,
I use the paper format A4 (210 mm x 297 mm).
In my RichViewEdit i to fix the left- and right margin at 20mm:

Code: Select all

...
function MMToPixels(mm: Integer): Integer;
var ppi: Integer;
begin
  ppi:=RichViewPixelsPerInch;
  if ppi = 0 then ppi:=Screen.PixelsPerInch;
  Result:=Round(mm * 5 * ppi / 127);
end;
...
RichViewEdit1.LeftMargin:=MMToPixels(20);
RichViewEdit1.RightMargin:=MMToPixels(20);
RichViewEdit1.MaxTextWidth:=MMToPixels(210)-RichViewEdit1.LeftMargin-RichViewEdit1.RightMargin;
RichViewEdit1.Format;
...
procedure TForm1.PrintPreviewButtonClick(Sender: TObject);
begin
  RVPrint1.AssignSource(RichViewEdit1);
  RVPrint1.LeftMarginMM:=0;
  RVPrint1.RightMarginMM:=0;
  RVPrint1.TopMarginMM:=0;
  RVPrint1.BottomMarginMM:=0;
  RVPrint1.HeaderYMM:=0;
  RVPrint1.FooterYMM:=0;
  RVPrint1.FormatPages(rvdoALL);
  RVPrintPreview1.First;
end;
...
The RVRuler in the RichViewEdit showing the margins correkt.
But the printpreview and the printout margins are approximate 25mm instead of 20mm (left-margin and right-margin).

Where is my bug? :?

Crowbar

Posted: Sun Nov 19, 2006 6:37 pm
by Sergey Tkachenko
Zero margins of TRVPrint are not possible. There are minimal margins values supported by printer. If RVPrint's margins are too small, it uses minimal values supported by the printer instead.

Ok, in the next update I'll add a new property to TRVPrint allowing to turn off margins correction.

Posted: Mon Nov 20, 2006 9:46 am
by Crowbar
Hi Sergey,
thanks for your informations.
I will waiting to the next update. :P

Crowbar