Jump to content

show report page numbers


---
 Share

Recommended Posts

Hi,

i would like to make a user aware of report pages wich have to tags assigned. How can i get the page number as in the table of contents using a script?

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

you could add a page counter in a loop:

# -*- coding: utf-8 -*-

import gom

#no_tag = []

pages = gom.app.project.reports
page_nr = 0

for i in pages:

	page_nr = page_nr + 1

	try:
		print('Page ', page_nr, 'has tag ', i.tags[0])
				
	except:
		print('No tag: page ', page_nr)
		#no_tag.append (i)
		

 

Link to comment
Share on other sites

  • 9 months later...

Hi Nanno, 

 

this is very usefull but...

 

If a page had multiple pages like :

 Capture.PNG.9d444f16bdd7258370efbf07092fccd9.PNG

 

the count is not working...

is there any solution to get the "real" page number ?

 

Thank a lot

Link to comment
Share on other sites

Just change the for loop to:

for i in pages:
	for j in i.pages:
		page_nr = page_nr + 1
	
		try:
			print('Page ', page_nr, 'has tag ', j.tags[0])
					
		except:
			print('No tag: page ', page_nr)
			#no_tag.append (j)

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...