Page 1 of 1

TSRichViewEdit / TSRVPrint and PrintFrames()

Posted: Thu Jun 09, 2016 8:01 pm
by Tavo
Hi, I am using ScaleRichView and I need to do my own routine for printing only a few pages.
I need to print pages-for example 1,4,13,15,16
I'm storing numbers desired pages in a list.
My code is something like this:

Code: Select all

  SRVPrint := TSRVPrint.Create(nil);
  try

     SRVPrint.SRichViewEdit := Edit;   // Edit is TSRichViewEdit
     SRVPrint.PrintMode := srvpAuto;
     SRVPrint.MetafileCompatibility := MainRVAControlPanel.MetafileCompatibility;

     for Page := 0 to Pages2.Count-1 do
        SRVPrint.PrintFrames(TituFinal, Pages2[Page]) ;

  finally
    SRVPrint.Free;
  end;
It seems to work, however there is something that I think is wrong: In the job list of the printer generates many jobs as pages I need.
I'm sure I'm doing something wrong, but I do not know what.
I hope you understand my bad English :-)
Thanks

Posted: Fri Jun 10, 2016 5:52 pm
by Sergey Tkachenko
SRVPrint.PrintFrames starts a new printing job.
Use PrintFramesEx instead

Code: Select all

  SRVPrint := TSRVPrint.Create(nil); 
  try 

     SRVPrint.SRichViewEdit := Edit;   // Edit is TSRichViewEdit 
     SRVPrint.PrintMode := srvpAuto; 
     SRVPrint.MetafileCompatibility := MainRVAControlPanel.MetafileCompatibility; 

     Printer.Title := TituFinal;
     Printer.BeginDoc;
     for Page := 0 to Pages2.Count-1 do 
        SRVPrint.PrintFramesEx(Pages2[Page]) ; 
     Printer.EndDoc;

  finally 
    SRVPrint.Free; 
  end;

Posted: Mon Jun 13, 2016 8:23 pm
by Tavo
Hello Sergey, thank you very much for answering. Now everything are in the same job, but for some reason does not print the first page.

If my list of pages is printed only 1.3 page 3
If my list of pages is printed only 2.4 page 4

Some clue? What am I doing wrong?
Thank you very much

Posted: Mon Jun 13, 2016 8:29 pm
by Sergey Tkachenko
Try

Code: Select all

   SRVPrint := TSRVPrint.Create(nil); 
   try 

      SRVPrint.SRichViewEdit := Edit;   // Edit is TSRichViewEdit 
      SRVPrint.PrintMode := srvpAuto; 
      SRVPrint.MetafileCompatibility := MainRVAControlPanel.MetafileCompatibility; 

      Printer.Title := TituFinal; 
      Printer.BeginDoc; 
      for Page := 0 to Pages2.Count-1 do 
      begin
         [color=red]if Page > 0 then
           Printer.NewPage;[/color]
         SRVPrint.PrintFramesEx(Pages2[Page]) ; 
      end;
      Printer.EndDoc; 

   finally 
     SRVPrint.Free; 
   end;

Posted: Tue Jun 14, 2016 12:38 pm
by Tavo
Yes! It works perfect!
thanks Sergey

TSRichViewEdit / TSRVPrint and PrintFrames

Posted: Mon Aug 26, 2019 1:31 pm
by ivanRar
If I place a TSRichViewEdit in a frame, the cursor is not shown. When I place the same TSRichViewEdit directly in the form that contains the frame, the cursor is visible and blinking. Using Delphi 10.3 Rio and ScaleRichView-Pre9.

Re: TSRichViewEdit / TSRVPrint and PrintFrames()

Posted: Mon Aug 26, 2019 2:02 pm
by Sergey Tkachenko