ReadPaperSizeFromPrinter, ReformatAll

  • I have the following peace of WPTools 4 code (BCB 5):

    At the end of (may be it's better to do this before?) a SuperMerge generation I optionally set a new paper size (from the printer):

    if (UsePaperFromPrinter) {
    WP->PaperDefs->Init( true );
    WP->ReadPaperSizeFromPrinter();
    WP->ReformatAll( false, false );
    }

    ReadPaperSizeFromPrinter() doesn't exist anymore. How to get the same functionality with WpTools 5?

    ReformatAll got two parameters. To get the same functionality as in WPTools 4, how to set them : false/false or false/true or... ?

    Should I always call WP->Invalidate() at the end?
    Do I have to call it, even if the second parameter (RepaintMemo) of ReformatAll is true?

    Thank you in advance,
    E. Hess

    • Offizieller Beitrag

    Hi,

    since the new WPSuperMerge does not use the page information it does not matter when the page size is changed. You can even change it later or type in the created report. If then the page breaks changed this should not harm the integrity of the report - asumed the automatic header/footers have been set up correctly.

    To assign the current paper size used by the printer use
    WPRichText.ReadPrinterProperties;

    ReformatAll gets the optional parameters:
    - Initialize
    - RePaint

    The first should be always false - except - if you have changed a style sheet. Only then the RTFEngine does not know which paragraphs need to be initialized. (Initialization means the the characters are measured, a rather slow process although highly optimized in WPTools)

    Repaint can be set to paint the memo as sson as the application is idle.

    Usually you do not have to call ReformatAll, only if you need to print the report right away.

    Invalidate should not be used WPTools 5 (no effect).