Page 1 of 1

save TDBRichViewEdit configuration

Posted: Thu Apr 19, 2018 9:59 pm
by aduarteprg
good night, friends, I started to study the component a little time I would like some tips. to find out how I can save the page's consigments in the database and load pull the text from the database here an A4 page. the way I'm doing when formatting the system is applying to all pages when I load the text. comes everything page size, alignment and etc. how can I save the settings for each text in the bank and load it from the bank when I bring the text.

Re: save TDBRichViewEdit configuration

Posted: Fri Apr 20, 2018 3:50 pm
by Sergey Tkachenko
Do you want to store information specified in DBRichView.DocParameters?

Re: save TDBRichViewEdit configuration

Posted: Sat Apr 21, 2018 2:48 pm
by aduarteprg
Good morning, I'm using the following code.

  rvemain.DocParameters.PageWidth: = 21;
  rvemain.DocParameters.PageHeight: = 29;
  rvemain.DocParameters.LeftMargin: = 2;
  rvemain.DocParameters.RightMargin: = 2;
  rvemain.DocParameters.TopMargin: = 2;
  rvemain.DocParameters.BottomMargin: = 2;
rveMain.Format;

It's still not correct, though.

pagina.png
pagina.png (75.15 KiB) Viewed 3372 times

Re: save TDBRichViewEdit configuration

Posted: Sat Apr 21, 2018 7:11 pm
by Sergey Tkachenko
TRichView does not use these properties for printing. They are used only for saving and loading in documents (RVF, RTF, DocX).
For printing, properties of TRVPrint are used (such as margins) and properties of the current printer (such as page size and orientation).

Here is how to store page information in RVF and apply it to TRVPrint (margins) and the current printer (page size):
https://www.trichview.com/forums/viewto ... f=3&t=3196

PS: Consider using ScaleRichView. It includes WYSIWYG editor component TSRichViewEdit, its page properties are automatically applied when printing.