trichview.com

trichview.support




Re: Printing Huge Documents


Return to index


Author

Message

Sergey Tkachenko

Posted: 10/18/2003 20:22:53


Yes, of course, I used two components just for an example.

Your code is correct. You can remove the line RichView1.Format(); (it's not

necessary, and the code will run faster).


There is one pitfall here. ContinuousPrint prints at least one line. What if

there is no place for it? You should start a new page yourself.


Height of printable area is RVPrint.rv.Height.


Add after the line:

RVPrint.StartAt := RVPrint.EndAt+60;


if RVPrint.rv.Height-RVPrint.StartAt<some safe value then

begin

  Printer.NewPage;

  RVPrint.StartAt := 0;

end;



>

> Much obliged for your helpful reply.  Using multiple RichView controls is

> not an option, since all sub-docs would need to be loaded together.

>

> Instead, would it OK to use ContinuousPrint from same RichView.  In other

> words can I expect reliable results from (pseudo) code below, or must I

wait

> for ContinuousPrint (async?) method to complete before reloading RichView.

>

> Thanks again...

> ---------------

>

> Printer.BeginDoc;

> RVPrint.StartAt := 0;

> RVPrint.AssignSource(RichView1);

> RVPrint.FormatPages(rvdoALL);

> RVPrint.ContinuousPrint;

>

> for i:= 1 to NumSubDocs do begin

>

>   RichView1.Clear();

>   RichView1.LoadRVFFromStream(NextSubDocStream);

>   RichView1.Format();

>

>   RVPrint.StartAt := RVPrint.EndAt+60;

>   RVPrint.FormatPages(rvdoALL);

>   RVPrint.ContinuousPrint;

>

> end;

>

> Printer.EndDoc;

> ---------------

>

> "Sergey Tkachenko" <[email protected]> wrote:

> >Yes, there is a way to print multiple documents in one printing job,

using

> >undocumented method TRVPrint.ContinuousPrint.

> >

> >This example shows how to print one document consisting of two RichViews

> >(RichView1 and RichView2).

> >

> >Printer.BeginDoc;

> >RVPrint.StartAt := 0;

> >RVPrint.AssignSource(RichView1);

> >RVPrint.FormatPages(rvdoALL);

> >RVPrint.ContinuousPrint;

> >RVPrint.StartAt := RVPrint.EndAt+60; // 60 pixels spacing between

documents

> >RVPrint.AssignSource(RichView2);

> >RVPrint.FormatPages(rvdoALL);

> >RVPrint.ContinuousPrint;

> >Printer.EndDoc;

> >

> >

> >

> >

> >

> >>

> >> I'm evaluating the RichView components for use in a document processing

> >app.

> >>  I need to handle big (huge!) documents, so I've adopted a master/sub

> >document

> >> structure.  Each sub-doc is stored separately (in a SQLite DB) and only

> >one

> >> sub-doc would be visible in a single RichView control at any one time.

> >Looks

> >> like this would work OK except for printing.  My question is...

> >>

> >> Is there any way to print the complete doc using RVPrint without

appending

> >> all sub-docs into one RichEdit.  I've studied the demos and searched

the

> >> RichView newsgroups but cannot figure out a solution.

> >>

> >> Any help or suggestions appreciated.

> >>

> >> Fergal

> >>

> >

> >

>





Powered by ABC Amber Outlook Express Converter