pdf numbering function