Unable to get pdf_pageHeader to work

Project:PDF Include project
Component:Code
Category:support request
Priority:normal
Assigned:jice
Status:closed
Description

I've attached the pdf file the code below generates for me...notice there is no page header. Not sure what my code is lacking. I've copied from the examples...so I'm confused.

My program is as follows:
{pdf/pdf_inc.i }

RUN pdf_new ("Spdf", "tmp/pdfTest.pdf").
RUN pdf_set_Orientation ("Spdf", "Portrait").
RUN pdf_set_LeftMargin ("Spdf", "10").
RUN pdf_set_PaperType ("Spdf", "LETTER").
RUN pdf_new_page ("Spdf").

pdf_PageHeader ("Spdf",THIS-PROCEDURE:HANDLE, "PageHeader").
RUN pdf_text_at ("Spdf", 'THIS IS A TEST', 10).
RUN pdf_skip("Spdf").

RUN pdf_set_font ("Spdf","COURIER",8.0).
FOR EACH soln WHERE so-nbr = 2781330 NO-LOCK:
RUN pdf_text_at
("Spdf",
(STRING(soln.so-nbr) + ' ' + STRING(soln.itm-nbr) + ' ADJUSTED'),
5).
RUN pdf_skip ("Spdf").
END.
RUN pdf_close ("Spdf").

PROCEDURE PageHeader:

DEF VAR L-hdrLn1 AS C FORMAT 'X(300)'.

L-hdrLn1 = '(soshpadj) ' + G-loginID + 'SO ADJUSTED REPORT' + ' PAGE: ' +
STRING(pdf_page("Spdf")) +
" of " + pdf_TotalPages("Spdf").

RUN pdf_set_font ("Spdf","Courier-Bold",12.0).

RUN pdf_text_xy ("Spdf",L-hdrLn1,1,600).

END.


AttachmentSize
pdfTest.pdf3.58 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#1

Assigned to:Anonymous» jice
Status:active» closed

pdf_pageHeader must be called before pdf_new_page, as pdf_new_page will call the header procedure, if defined.
closing the issue.