Page 1 of 1

How to add page numbers using PlaceHeadersAndFooters?

Posted: Thu Jan 05, 2017 6:56 pm
by mmasood
Hi,

I want to add page numbers to the banner text using the PXC_Document.PlaceHeadersAndFooters method? I could not find anything on the help site as well as the forum. Can you provide some sample code on how to do this?

Regards,
M

Re: How to add page numbers using PlaceHeadersAndFooters?

Posted: Fri Jan 06, 2017 7:42 am
by Sasha - Tracker Dev Team
Hello mmasood,

If you are talking about the automatic page numeration, like the End-User Editor does, then use the same macros as you would use in the Headers And Footers dialog. For example:

Code: Select all

RightHeaderText = "<<1 of n>>";
Cheers,
Alex

Re: How to add page numbers using PlaceHeadersAndFooters?

Posted: Fri Jan 06, 2017 1:51 pm
by mmasood
Hi Alex,

I am using Core API 6.0.319.0. I tried setting the text like you mentioned above but it just prints out the text itself instead of the page number.

Regards,
M

Re: How to add page numbers using PlaceHeadersAndFooters?

Posted: Mon Jan 09, 2017 2:08 pm
by mmasood
Hi Alex,

Any update on this? Following is the code that I am using:

Code: Select all

    Set pIndex = pAInt.CreateBitSet(pageCount)
    pIndex.Set 0, pageCount
    
    Dim kfz As IPXC_HeaderAndFooterParams
    Set kfz = pInst.CreateHeaderAndFooterParams
    
    kfz.CenterHeaderText = "<<1 of n>>"
    
    pDoc.PlaceHeadersAndFooters pIndex, kfz
Regards,
M

Re: How to add page numbers using PlaceHeadersAndFooters?

Posted: Mon Jan 09, 2017 3:09 pm
by Will - Tracker Supp
Hi mmasood,

Alex is currently off celebrating the Orthodox Christmas, as with the rest our Ukrainian office, but we'll try to get an update for you within the next day or so.

Thanks,