Print header issue

  • Hi,

    sometimes, when I load and print a file, the text of header goes to the footer,

    if I do a preview before print, always work,

    I think this is a refresh issue, I'm using Delphi 7 + Wptools 8

    var

    St: TMemoryStream;

    WPRichText1.LoadFromStream(St);

    WPRichText1.Refresh;

    WPRichText1.ReformatAll();

    WPRichText1.Print;

    • Offizieller Beitrag

    You need to call

    WPRichText1.LoadFromStream(St, '', true);

    to make sure the editor is clear.

    Or, if you want to keep header and footer, do this:

    WPRichText1.ActiveText := WPRichText1.BodyText;

    WPRichText1.LoadFromStream(St);

    so the cursor is in the body text before you load the text.