I have use [PDFView setNeedsDisplay:YES]
to let the PDF view redraw, and it worked great on OSX 10.9-10.11.
However it doesn\'t work unless I zoom in or zoom o
I'm having the same trouble. The first time I add an annotation, PDFView
displays that annotation on the page immediately. From then on, adding or removing an annotation works fine in code but PDFView
doesn't show the change until I manually scroll the view.
From PDFKit
I've tried:
previewView.layoutDocumentView()
for pageIndex in 0...pdf.pageCount - 1 {
let page = pdf.page(at: pageIndex)!
previewView.annotationsChanged(on: page)
}
and from NSView
I've tried:
previewView.needsDisplay = true
previewView.needsLayout = true
previewView.documentView?.needsDisplay = true
previewView.updateLayer()
but no luck. I've tried scrolling the PDFView
with code too but it hasn't been a reliable way of sneaking a refresh, and in general shouldn't be the way to do this.