Posts

Post not yet marked as solved
0 Replies
338 Views
Hi, I encounter various problems with inserting PKDrawing into a PDFAnnotation : First : After "page.addAnnotation(myCustomAnnotation)", saved document seems corrupted (affected pages are displayed with a "X" watermark covering the whole page), Second : The only way to extract PKDrawing from the annotation is unarchiveTopLevelObjectWithData: which is deprecated, Final : I'm not able to re-read PKDrawings to restore PKCanvasView undoManager. Does anyone have an idea on a correct way to do this? Thank you in advance and happy new year everyone!
Posted
by Aflaf.
Last updated
.
Post not yet marked as solved
1 Replies
532 Views
Hi, I'm trying to use PencilKit over PDFKit as described in https://developer.apple.com/videos/play/wwdc2022/10089/. The thing is I open my custom UIDocument and initialize all its content to feed PDFView. Everything seems to work, I Input sketches in the canvas, PDFPageOverlayViewProvider's overlayView(for:) generates canvas correctly (it seems) but when editing finishes : willEndDisplayingOverlayView never gets called, and when I save the UIDocument (I use document.close(completionHandler:)) contents(forType:) never sees my custom PDFPages and I get no content for sketches. Does anyone of you have an idea of the lifecycle we should follow to get the methods called ? Sincerely yours
Posted
by Aflaf.
Last updated
.