How Can I do ?The SRichViewEdit only to print the new content
When the Next print ,I Can Free choice print starting point
How Can I do ?The SRichViewEdit only to print the new conten
-
- Posts: 29
- Joined: Mon May 07, 2012 2:36 am
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 29
- Joined: Mon May 07, 2012 2:36 am
YES
Sergey Tkachenko wrote:Do you want to print on the same paper as the old content was printed?
Is the new content added to the end of the document?
YES
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
After the first print, store the count of items in some integer variable:
LastPrintedItemCount := SRichViewEdit1.RichViewEdit.ItemCount.
When printing next time, assign
SRichViewEdit1.MinPrintedItemNo := LastPrintedItemCount;
Then you can store the count of items in LastPrintedItemCount again, and so on.
LastPrintedItemCount := SRichViewEdit1.RichViewEdit.ItemCount.
When printing next time, assign
SRichViewEdit1.MinPrintedItemNo := LastPrintedItemCount;
Then you can store the count of items in LastPrintedItemCount again, and so on.
-
- Posts: 29
- Joined: Mon May 07, 2012 2:36 am
Thank you! You Are Right.Sergey Tkachenko wrote:After the first print, store the count of items in some integer variable:
LastPrintedItemCount := SRichViewEdit1.RichViewEdit.ItemCount.
When printing next time, assign
SRichViewEdit1.MinPrintedItemNo := LastPrintedItemCount;
Then you can store the count of items in LastPrintedItemCount again, and so on.
Then i want to Print where my selected text,some people tell me,use GetSelBounds. what can i do?
Thank you very much
-
- Posts: 29
- Joined: Mon May 07, 2012 2:36 am
The problem has been solved .kisshexuxia wrote:Thank you! You Are Right.Sergey Tkachenko wrote:After the first print, store the count of items in some integer variable:
LastPrintedItemCount := SRichViewEdit1.RichViewEdit.ItemCount.
When printing next time, assign
SRichViewEdit1.MinPrintedItemNo := LastPrintedItemCount;
Then you can store the count of items in LastPrintedItemCount again, and so on.
Then i want to Print where my selected text,some people tell me,use GetSelBounds. what can i do?
Thank you very much
I use GetSelectionBounds to get startItemNo,endItemNo.
rve.RVData.GetSelectionBounds(startItemNo,startItemOfs,endItemNo,endItemOfs,false);
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Yes, but it may be not what the user expects.
If you use MinPrintedItemNo and MaxPrintedItemNo to print only items belonging to the selection, there will be the following problems:
1) If the item is selected only partially, it will still be printed completely.
2) The selection will be printed at the same position on the page(s) as it is in the original document. But (I believe) the user expects that it will be printed from the beginning of the page.
Currently, the only solution is to create a hidden TSRichViewEdit, copy the selection to it, and then print this hidden TSRichViewEdit.
A code for copying:
If you use MinPrintedItemNo and MaxPrintedItemNo to print only items belonging to the selection, there will be the following problems:
1) If the item is selected only partially, it will still be printed completely.
2) The selection will be printed at the same position on the page(s) as it is in the original document. But (I believe) the user expects that it will be printed from the beginning of the page.
Currently, the only solution is to create a hidden TSRichViewEdit, copy the selection to it, and then print this hidden TSRichViewEdit.
A code for copying:
Code: Select all
var Stream: TMemoryStream;
if not SRichViewEdit1.ActiveEditor.SelectionExists then
exit; // no selection;
Stream := TMemoryStream.Create;
SRichViewEdit1.SaveRVFToStream(Stream, True);
Stream.Position := 0;
SRichViewEditHidden.RichViewEdit.LoadRVFFromStream(Stream);
Stream.Free;
// now print SRichViewEditHidden