How to add page numbers using PlaceHeadersAndFooters?

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
mmasood
User
Posts: 99
Joined: Fri Sep 18, 2015 9:49 pm

How to add page numbers using PlaceHeadersAndFooters?

Post by mmasood » Thu Jan 05, 2017 6:56 pm

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

User avatar
Sasha - Tracker Dev Team
User
Posts: 4522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to add page numbers using PlaceHeadersAndFooters?

Post by Sasha - Tracker Dev Team » Fri Jan 06, 2017 7:42 am

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
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

mmasood
User
Posts: 99
Joined: Fri Sep 18, 2015 9:49 pm

Re: How to add page numbers using PlaceHeadersAndFooters?

Post by mmasood » Fri Jan 06, 2017 1:51 pm

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

mmasood
User
Posts: 99
Joined: Fri Sep 18, 2015 9:49 pm

Re: How to add page numbers using PlaceHeadersAndFooters?

Post by mmasood » Mon Jan 09, 2017 2:08 pm

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

User avatar
Will - Tracker Supp
Site Admin
Posts: 6819
Joined: Mon Oct 15, 2012 9:21 pm
Location: London, UK
Contact:

Re: How to add page numbers using PlaceHeadersAndFooters?

Post by Will - Tracker Supp » Mon Jan 09, 2017 3:09 pm

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,
If posting files to this forum, you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded.
Thank you.

Best regards

Will Travaglini
Tracker Support (Europe)
Tracker Software Products Ltd.
http://www.tracker-software.com

Post Reply