cancel
Showing results for 
Search instead for 
Did you mean: 

Page number to get displayed only when the page count is more than 1

Former Member
0 Kudos

Hi Gurus,

My requirement is to print page numbers ONLY if the page count is more than 1 ,i.e. if the data getting displayed in 1 page only then don't print "Page n of m" but if it is getting displayed in more than 1 page then display "Page n of m" on TOP right corner.

I selected "Page n of m" and it creates 3 fields in object hierarchy i.e TextField CurrentPage, TextField PageCount and Static Text field Pages.

I go to the ready:layout of PageCount object, and use below script:

this.rawValue = xfa.layout.pageCount();

if (this.rawValue == 1) {

this.parent.Pages.presence = "invisible";

}

I looked at the message but it doesnot resolve my problem.

Please help me out.

Regards

Ajay

Accepted Solutions (0)

Answers (1)

Answers (1)

rakesh_m2
Contributor
0 Kudos

Hello Ajay,

Script do not work for TextFields. to get the page numbers displayed. Select Text field from library and Go to Object Pallete, Value tab and select "Calculated - Read Only" in Type and choose Runtime property. There you can find the Number of Pages.

Once this is the text field, you can write script on it.

If(this.rawValue == 1)

{

this.presence = "invisible"

}

similarly write script for total number of pages, but make sure that variable is accessed properly.

Please let me know, if you still see some issues with it.

Thanks,

Rakesh