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.
how insert into TRichview a superscript or subscript symbol?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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
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"
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;
http://www.trichview.com/forums/viewtopic.php?t=87
"How to print the chosen pages"