Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

Retrieve page number from PDFPage instance

More
IP: 151.0.245.62 7 years 1 month ago #14312 by fabmar
Hi team,
which is the correct way to retrieve the page number from a PDFPage and a PDFDoc instance?

Is the snippet below correct?
Code:
int currentPage; PDFDoc *currentDoc = ... //Current doc instance PDFPage *page = ... //page instance for (int i = 0; i < [currentDoc pageCount]; i++) { if ([page advanceGetRef] == [[currentDoc page:i] advanceGetRef]) { currentPage = i; break; } }

Thanks in advance.

Fabio Mariani
More
IP: 111.196.247.186 7 years 1 month ago #14313 by radaee
no direct way to know page NO from PDFPage object.
if you need this feature, you can:
1.add private attribute to PDFPage. like "int pageno"
2.set this attribute in method [PDFDoc page].
then you can using [page pageno] to known page index.

but i don't recommand you to do this.
because, after create or delete page, the pageno may changes.
Time to create page: 0.384 seconds
Powered by Kunena Forum