Hello Sergey!
I'm having problems with the printing of documents.
I need to have the possibility to choose between printing odd or even pages and also the possibility to choose which pages to print. Currently there are: "to" 1 "through" 10 "I need to choose" 1, 2, 5, 6, 8, 9.
This is very important for our company.
I'm having problems with the printing of documents.
I need to have the possibility to choose between printing odd or even pages and also the possibility to choose which pages to print. Currently there are: "to" 1 "through" 10 "I need to choose" 1, 2, 5, 6, 8, 9.
This is very important for our company.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
The example (of TRVPrint): http://www.trichview.com/forums/viewtopic.php?t=87#253
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Do you use ScaleRichView (TSRichViewEdit) instead of TRichViewEdit+TRVPrint?
In this case, you should use different method: create TSRVPrint, assign a TSRichViewEdit control to its SRichViewEdit property, srvpAuto to its PrintMode property, and call SRVPrint.PrintFrame(PageNo, 1) to print one page. The rest of code is the same as in the example above.
As for the user interface. RichViewActions, both for TRichViewEdit and TSRichViewEdit, uses the standard printing dialog (TPrintDialog). This dialog does not support a sophisticated definition of the pages to print. And, since this is a standard windows dialog, it cannot be modified.
I am afraid you need to create a new dialog yourself.
In this case, you should use different method: create TSRVPrint, assign a TSRichViewEdit control to its SRichViewEdit property, srvpAuto to its PrintMode property, and call SRVPrint.PrintFrame(PageNo, 1) to print one page. The rest of code is the same as in the example above.
As for the user interface. RichViewActions, both for TRichViewEdit and TSRichViewEdit, uses the standard printing dialog (TPrintDialog). This dialog does not support a sophisticated definition of the pages to print. And, since this is a standard windows dialog, it cannot be modified.
I am afraid you need to create a new dialog yourself.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
TPrintDialog allows choosing the printer, define a range of pages to print (all / from-to / selection), define a number of copies.
Depending on the values chosen in this dialog, TsrvActionPrint calls either SRichView.PrintAll or SRichView.PrintRange as many times as the number of copies specified.
Do you ask about printing a selection?
In TsrvActionPrint, selection printing is not implemented, so it is disabled.
In TrvActionPrint (for TRichViewEdit), it is implemented in the following way: a temporal hidden TRichView is created, the selection is copied to this TRichView, it is printed, then destroyed.
If you need, I can implement it in TsrvActionPrint for TSRichViewEdit in the same way.
But if you want to modify this dialog to allow more complex defining of pages to print, like in your first post, it is not possible. You need to create your dialog instead.
Depending on the values chosen in this dialog, TsrvActionPrint calls either SRichView.PrintAll or SRichView.PrintRange as many times as the number of copies specified.
Do you ask about printing a selection?
In TsrvActionPrint, selection printing is not implemented, so it is disabled.
In TrvActionPrint (for TRichViewEdit), it is implemented in the following way: a temporal hidden TRichView is created, the selection is copied to this TRichView, it is printed, then destroyed.
If you need, I can implement it in TsrvActionPrint for TSRichViewEdit in the same way.
But if you want to modify this dialog to allow more complex defining of pages to print, like in your first post, it is not possible. You need to create your dialog instead.
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Sergey procedure is giving this error in the "Printer": Undeclared identifier 'Printer'. You know why?
PrintSomePages procedure (const Title: String;
RVPrint: TRVPrint; const Pages: array of Integer);
var i: Integer;
begin
Printer.Title: = Title;
Printer.BeginDoc;
for i: = Low (Pages) to High (Pages) do begin
if i <> Low (Pages) then
Printer.NewPage;
RVPrint.rv.DrawPage (Pages , Printer.Canvas, False, False)
end;
Printer.EndDoc;
end;
PrintSomePages procedure (const Title: String;
RVPrint: TRVPrint; const Pages: array of Integer);
var i: Integer;
begin
Printer.Title: = Title;
Printer.BeginDoc;
for i: = Low (Pages) to High (Pages) do begin
if i <> Low (Pages) then
Printer.NewPage;
RVPrint.rv.DrawPage (Pages , Printer.Canvas, False, False)
end;
Printer.EndDoc;
end;
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Hey sergey
I used this command to print a check but when he returns to printing, the screen is only a selection that was printed
begin
/ / copying the selection
Stream: = TMemoryStream.Create;
try
Edit.RichViewEdit.SaveRVFToStream (Stream, True);
Stream.Position: = 0;
Edit.LoadRVFFromStream (Stream);
finally
Stream.Free;
end;
/ / printing
Edit.PrintAll;
end;
know why this happens?
I used this command to print a check but when he returns to printing, the screen is only a selection that was printed
begin
/ / copying the selection
Stream: = TMemoryStream.Create;
try
Edit.RichViewEdit.SaveRVFToStream (Stream, True);
Stream.Position: = 0;
Edit.LoadRVFFromStream (Stream);
finally
Stream.Free;
end;
/ / printing
Edit.PrintAll;
end;
know why this happens?
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: