trichview.com

trichview.support




Re: RichViewEdit and paper size


Return to index


Author

Message

Mike Anderson

Posted: 02/26/2005 4:55:27


Thank you very much for reply.


I may miss explained what I need, I meant how to set RichViewEdit width to

printer paper width

like MS word. Open MS word, and select Custom size and type width 4" and

Height =3"

You will the ruler changed and user input limited.


Is this doable with RichViewEdit ?


I hope your understand my question.


Thanks





"Sergey Tkachenko" <svt@trichview.com> wrote in message

news:421e3995$3@support.torry.net...

> uses Printers;

>

> procedure SetPaperSize(PaperSize: Integer);

>  var ADevice, ADriver, APort: array[0..79] of Char;

>      ADeviceMode: THandle;

>      DevMode: PDeviceMode;

>  begin

>    Printer.GetPrinter(ADevice,ADriver,APort,ADeviceMode);

>    if ADeviceMode<>0 then begin

>      DevMode := PDeviceMode(GlobalLock(ADeviceMode))

>      end

>    else

>      raise Exception.Create('Error initializing printer');

>    DevMode.dmFields := DevMode.dmFields or DM_PAPERSIZE;

>    DevMode.dmPaperSize := PaperSize;

>    GlobalUnlock(ADeviceMode);

>    Printer.SetPrinter(ADevice,ADriver,APort,ADeviceMode);

>  end;

>

> You can find a list of available paper sizes in Windows API Help (Delphi

> menu: Help | Windows SDK).

> Search DEVMODE in the help index, then search for DMPAPER_*** constants.

>

> For example,  SetPaperSize(DMPAPER_A4)

>

> Do not forget to call RVPrint.FormatPages after any change in paper sizes.

>

> You can get the current printer's paper size:

>

> function GetPaperSize: Integer;

> var ADevice, ADriver, APort: array[0..79] of Char;

>    ADeviceMode: THandle;

>    DevMode: PDeviceMode;

> begin

>  Printer.GetPrinter(ADevice,ADriver,APort,ADeviceMode);

>  if ADeviceMode<>0 then begin

>    DevMode := PDeviceMode(GlobalLock(ADeviceMode))

>    end

>  else

>    raise Exception.Create('Error initializing printer');

>  Result := DevMode.dmPaperSize;

> end;

>

> You can see how to get a list of available paper sizes and their names in

> the RichViewActions source code (in page setup form)

>

>> Hello,

>>

>> Thanks in advance.

>> Is it possible to set printer paper size to RichViewEdit size or Vise

> versa

>> Example set RichViewEdit1 size to A4 or A3 or legal size.

>>

>> I know paper size set by printer, I would like to limit users input to

>> printer paper size.

>>

>>

>> Thanks

>>

>>

>>

>

>





Powered by ABC Amber Outlook Express Converter