Julian:
I haven't heard back from you on this topic, so I don't know if my e-mails are getting through. My problem sounds similar to the "Keep Next Problem" post, but V4.20 still has the problem. To re-iterate the problem, if I do a merge on a very simple document, whenever MergeParagraph hits a point where the distance between the bottom of the page and the last line of the paragraph is within a certain distance, it aborts the merge at the last completed page, rather than properly setting up to continue the paragraph at the next page. If I comment out the if statement around line 2270 in WPMerge that states:
if diff < FDestination.Header.FFontYPixelsPerInch div 10 then // 0.12 cm - one small line savety distance
then the merge completes, but I end up with one or more pages with a single line at the top. I'm attaching one of my e-mails that contains instructions on duplicating the problem.
I look forward to your response, and if anyone else has encountered this issue or resolved it, please let me know. Note that this used to work fine in V3.X of WPTools.
Sincerely,
Dr. Michael D. Foegelle
> > I can send you a project if you need it, but if you drop two
> > WPRichTexts, a WPSuperMerge, a Memo, and a button on a form
> > and put the following code in the click event of the button,
> > you'll get a demonstration of the problem. All this code
> > does is fills the control with 500 lines of text, then
> > changes the font size of the entire text and merges it for
> > different font sizes, checking to see if the merged document
> > has the same number of pages as the original. I get slightly
> > different results depending on whether I comment out the
> > rm1440 lines, but it still does it both ways. The mismatch
> > occurs when the line "if diff <
> > FDestination.Header.FFontYPixelsPerInch div 10 then // 0.12
> > cm - one small line savety distance" (around line 2270 in
> > WPMerge) of MergeParagraph is true. Anything you can do to
> > help would be appreciated.
> >
> > Sincerely,
> >
> > Dr. Michael D. Foegelle
> >
> >
> >
> > WPRichText1->Clear();
> >
> > AnsiString text;
> > for (int i = 0; i<500; i++)
> > text += (AnsiString) "This is test line #" +
> > (i+1) + "\r\n";
> >
> >
> > WPRichText1->Text = text;
> > text = "";
> >
> > for (int i = 5; i< 20; i++){
> > WPRichText1->SelectAll();
> > WPRichText1->Font->Size = i;
> >
> > //{ Empty the destination }
> > WPRichText2->Clear();
> > // { We need ScreenResMode 1440 ! }
> > // WPRichText1->ScreenResMode = rm1440;
> > // WPRichText2->ScreenResMode = rm1440;
> > //{ Copy the page and other settings to destination }
> > WPRichText2->FastCopyProperties(WPRichText1->Header);
> > //{ This starts the report creation }
> > WPSuperMerge1->Execute();
> > //{ Refresh the destination RTF text }
> > WPRichText2->Refresh();
> >
> > int p1 = WPRichText1->CountPages(), p2 =
> > WPRichText2->CountPages();
> > if (p1 != p2)
> > text += (AnsiString) "Mismatched page
> > count (" + p1 + " != " + p2 +
> > ") at font
> > size = " + i + ".\r\n";
> > }
> > Memo1->Text = text;
> >
> >
> > ------- Sample Output -------
> >
> > Mismatched page count (5 != 1) at font size = 5.
> > Mismatched page count (6 != 1) at font size = 6.
> > Mismatched page count (7 != 1) at font size = 7.
> > Mismatched page count (7 != 1) at font size = 8.
> > Mismatched page count (11 != 12) at font size = 11.
> > Mismatched page count (11 != 1) at font size = 12.
> > Mismatched page count (12 != 1) at font size = 13.
> > Mismatched page count (13 != 1) at font size = 14.
> > Mismatched page count (14 != 1) at font size = 16.
> > Mismatched page count (16 != 1) at font size = 17.