footers & PpPrintWidget

How can I have a footer printed on every page of a multi-page
printout?
Esp if the widget to be printed has a PtList, PtMultiText
or PtMultiText?

Is this possible?

acellarius@yahoo.com wrote:

How can I have a footer printed on every page of a multi-page
printout?
Esp if the widget to be printed has a PtList, PtMultiText
or PtMultiText?

acellarius@yahoo.com wrote:

Is this possible?

acellarius@yahoo.com > wrote:

How can I have a footer printed on every page of a multi-page
printout?
Esp if the widget to be printed has a PtList, PtMultiText
or PtMultiText?

Hello,

I have no real idea how to go about this, but I have looked at PHS
files before, and there should be some way to do what you want I
would think. I am guessing you are opening a printer context, then
forcing a multi-text to draw (PpPrintWidget), right? Looking at the APIs,
I believe the only way you could do this is by “handling the printing”
yourself, by getting the text/data, printing some, print the footer, repeat.
Hopefully someone else can provide a more indepth/better answer.

Regards.

Hello,

I have no real idea how to go about this, but I have looked at PHS
files before, and there should be some way to do what you want I
would think. I am guessing you are opening a printer context, then
forcing a multi-text to draw (PpPrintWidget), right? Looking at the APIs,
I believe the only way you could do this is by “handling the printing”
yourself, by getting the text/data, printing some, print the footer, repeat.
Hopefully someone else can provide a more indepth/better answer.

Regards.

Indeed this what I am doing, straight out of the helpviewer
example code (see below).
The problem is that there is a PtList in the widget to be printed,
which may have content on it that will require more than a
single page to print.
The advice in the Helpviewer is to cause the PtList to resize.
This will cause the whole list to be visible.
However, at the bottom of each page, I need to print a date printed
and a page count, as well as total pages printed.

There doesn’t seem to be a way to intercept the end of page
so one can draw some additional info, correct?

The only way I can think of is to have 3 types of page widgets,
start, middle, end. Each page has a fixed length.
The information to be printed must be transferred, 1 page at a
time, to the printer page widget.
Each page has a footer widget.

Calculate somehow, in advance, how many pages will be needed.
(How to do this?)

Insert the info that can fit on the 1st page.
Update footer widget
print 1st page.

Repeat
insert info on middle page
update footer
print
until 2nd last page

Print last page.

For my case this will work but for some print jobs it will be difficult.
e.g. bitmaps

It does seem primitive though…

int
print_results_cb ( PtWidget_t *widget, ApInfo_t *apinfo,
PtCallbackInfo_t *cbinfo ) {

int result;
PtPrintSelectionInfo_t info;
PpPrintContext_t *pc;
PtWidget_t *result_sheet;

pc = PpCreatePC( );
result = PtPrintSelection(
//ApCreateModule(ABM_mrt_test_results_dlg, NULL, NULL),
NULL,
NULL,
“Print results”,
pc,
Pt_PRINTSEL_DFLT_LOOK);
if ( result != Pt_PRINTSEL_CANCEL ) {
/* Get the nonprintable area and page size. Both are in
1/1000ths of an inch. */

PpStartJob(pc);
PpContinueJob(pc);
result_sheet=ApCreateModule(ABM_test_results_sheet_dlg, NULL,
NULL);
/Populate the results sheet/

sprintf(temp_str, “Compile Date: %s %s”, DATE, TIME);
PtSetResource(ABW_sheet_sw_compile_date, Pt_ARG_TEXT_STRING,
temp_str, 0);

sprintf(temp_str, “MRT S/W Issue %s”, SW_VER);
PtSetResource(ABW_sheet_sw_version_txt, Pt_ARG_TEXT_STRING,
temp_str, 0);

PpPrintWidget(pc, result_sheet, NULL, NULL, Pt_PP_RESIZE_PC);
PpSuspendJob(pc);
PpEndJob(pc);
PtUnrealizeWidget(result_sheet);
}


return( Pt_CONTINUE );
}