Tuesday, 21 May 2019

PDFKit: How to move current page in PDFView to a specific offset

Assuming there is only one page in the PDF. What I am trying to achieve: Save Zoom and offset of a PDFPage currently being viewed and show the page at exact same offset and zoom level when user comes back to that page. What I have achieved: Calculated the offset and zoom and on page reload, successfully shown saved zoom level of page. Iam unable to set the offset. Tried using following methods, but no effect.

1)

[_pdfView goToRect:rect onPage:[_pdfView.document pageAtIndex: page.unsignedLongValue ]];

2)

PDFDestination *destination =  [_pdfView.currentDestination initWithPage:[_pdfView.document pageAtIndex: page.unsignedLongValue ] atPoint:viewPoint];
    [_pdfView goToDestination:destination];



from PDFKit: How to move current page in PDFView to a specific offset

No comments:

Post a Comment