iosmacoscocoapdfview

PDFview scrolls to bottom of the page in single page document


I am creating a PDFViewer application. I have set the autoScale Property of the PDFViewer to true, so that it the view expands to the width of the screen. Works fine with large PDF documents. But when the document is a single page document, the page automatically scrolls down to the end of the page, instead of starting with the beginning. I just cant understand the root cause of it. What am I missing here?


Solution

  • I think this is a bug in PDFView.

    As workaround I suggest to manually scroll top the top:

    self.pdfView.document = pdfDocument;
    
    NSPoint pt = NSMakePoint(0.0, [self.pdfView.documentView bounds].size.height);
    [self.pdfView.documentView scrollPoint:pt];
    

    Bug Reporter

    rdar://37942090: PDFview scrolls to bottom of the page in single page document.