how insert into TRichview a superscript or subscript symbol?

General TRichView support forum. Please post your questions here
Post Reply
sky_234
Posts: 24
Joined: Sat Feb 18, 2006 1:27 pm

how insert into TRichview a superscript or subscript symbol?

Post by sky_234 »

1. Do you know that how insert into TRichview a superscript or subscript symbol? Example square symbol.
2. I have a problem again. I need judge those blank pape in preview model.Then I don't print those blank page, only print page that having text. How can I do?
Thanks.
Sergey Tkachenko
Site Admin
Posts: 17604
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

1. You can move text up or down - change VShift property of text style
2. Blank pages? I guess, if they are created by user, the user wants them to be printed. If they were generated, it's better to change a generation procedure to not produce empty pages.

Well, ok.

Use RVPrint.GetFirstItemOnPage to get a range of items on the specified page

Code: Select all

var IsEmpty: Boolean;
      ParaNo, i, FirstItemNo, LastItemNo, Offs: Integer;

IsEmpty := True; // is the PageNo-th page  empty?
  // the first page has index = 1

RVPrint1.GetFirstItemOnPage(PageNo, FirstItemNo, Offs);
if PageNo=RVPrint1.PagesCount then
  LastItemNo := RichView1.ItemCount-1
else
  RVPrint1.GetFirstItemOnPage(PageNo+1, LastItemNo, Offs);

for i := FirstItemNo to LastItemNo do begin
  if RichView1.GetItemStyle(i)<0 then begin
    // nontext item on page
    IsEmpty := False;
    break;
  end;
  if RichView1.GetItemText(i)<>'' then begin
    // some text on page
    IsEmpty := False;
    break;
  end;
  ParaNo := RichView1.GetItemPara(i);
  if (RichView1.Style.ParaStyles[ParaNo].Background.Color<>clNone) or
     (RichView1.Style.ParaStyles[ParaNo].Border.Style<>rvbNone) then
    // visible paragraph background
    IsEmpty := False;
    break;
  end;
end;
As for code for printing only the specified pages, see
http://www.trichview.com/forums/viewtopic.php?t=87
"How to print the chosen pages"
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Post by Denoson »

You can modify standard action: ChangeFontAction (hide default dialog).
Post Reply