printing scrollable multi-text

Hi,

How to print the text in a scrollable MultiText widget whose content
exceeds one page. The example given in the help prints only one page
even if the content in the MultiText extends beyond one page.

Thanks in advance for your help.

Hi,

Sorry for the late response.

To get multiple pages to print can be done with the following steps.

  1. Create another multitext widget -call it the print widget - that is
    not visible to the user(i.e. hide it behind the users multitext widget).
    So when the user hits print the rest of the steps are followed.

  2. Get the printer setting for printing - i.e. orientation, page size,
    margins.

  3. Adjust the printer setting for what you want and then use PpSetPC()
    to set them.

  4. Set the print multitext widget margins to match that of the printers
    that you just set.

  5. Start your print job - PpStartJob().

  6. Get the users multitext widget resources (i.e. text, fonts, number
    of lines) and then set the print multitext widget’s resources to match
    these.

  7. You will need to go through the users multitext and get the
    attributes for each line (color, font, tabs, etc) and then set the print
    multitext widget’s accordingly.

  8. Once the attributes have been set to match. You can then set what
    the top line of the print multitext widget is, this gets you positioned
    to start printing.

  9. You need to get a pointer to how many lines are completely visible
    for the print multitext widget. By this time you should already have
    the total number of lines stored somewhere.

  10. Then you will loop through checking the lines printed against the
    total number of lines to be printed. You would PpContinueJob(),
    PpPrintWidget(), then PpSuspendJob() - thereby printing a page. After
    this you would take the lines you just printed in the print multitext
    widget and delete them, which causes the next group of lines you want to
    print to move into the visible lines of the widget. Call
    PpPrintNextPage() and start your loop again.

Once this is complete it should print the multiple pages your looking
for from the print multitext widget and not affecting the users
multitext widget which will be showing on the screen. This is a summary
of the steps you’ll need to look - I am hitting just the highlights!

Hope this helps
Regards
Brenda


svijayab@in.ibm.com wrote:

Hi,

How to print the text in a scrollable MultiText widget whose content
exceeds one page. The example given in the help prints only one page
even if the content in the MultiText extends beyond one page.

Thanks in advance for your help.