TSRichViewEdit / TSRVPrint and PrintFrames()

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

TSRichViewEdit / TSRVPrint and PrintFrames()

Post 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
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post 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
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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;
Tavo
Posts: 175
Joined: Sat Sep 24, 2005 9:25 pm
Location: Buenos Aires, Argentina
Contact:

Post by Tavo »

Yes! It works perfect!
thanks Sergey
ivanRar
Posts: 3
Joined: Fri Aug 16, 2019 3:01 pm

TSRichViewEdit / TSRVPrint and PrintFrames

Post 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.
Post Reply