Blurry and low resolution of PKCanvasView, as overlayview from PDFView.

Hi, I am trying to make a simple note taking app that users can draw something on pdfview with apple pencil.

(I used PDFKit, PencilKit for the code.)

I followed the instruction code of WWDC22's "What's new in PDFKit." - "overlayProvider" (so you can see the code at the video.) I was able to draw something each view of pdf page.

But the issue was, the resolution of overlayview or subview of pdfview is low. As far as I know, the pkcanvasview draws vertor-based drawings. So I never thought the image or the lines I draw will be that blurry.

Is this buggy or is this the normal thing? (+ I added a uibutton as subview of pdfview and the button also looks blurry.)

  1. I even tried to scale up the all the subviews when the subviews' layout is done, using contentScaleFactor.
  2. PKCanvasView inherits UIScrollView, so I enlarged the frame of pkcanvas view and fixed the scale to below 1.0. If the pkcanvasview looks blurry and that is because somewhat zoomed in wrong way, zooming out should be the solution. But, didn't work. Still blurry.
  3. and any other stuff like changing frame or size.

So, anyone having same problem with me, or anyone can give me any solution. Please help me. I wish this is bug thing that can be fixed in any moment.

-> This image is little bit zoomed in. but the drawing is blurry.

and this is the normal pkcanvasview drawing, just subview of view(of VC).

I'm experiencing the same behavior, tried all ideas, but none worked. Is anyone experienced with this?

I have the same problem. Is there any solution?

I don't know if this is the best way or not, but I've been trying for a long time to figure out how to solve this problem until I finally realised that the main problem is that the PKCanvasView view must be separated from the PDFView or any other view that contains a UIScrollView and we want it to be superimposed.

So, in this case, if we overlay a PKCanvasView and underneath a PDFView, which itself already has a UIScrollView, the moment we want to use the PKCanvasView we must rely on the UIScrollView of the PKCanvasView itself by using its delegate to catch the func scrollViewDidScroll(_ scrollView: UIScrollView) and then synchronise the zoomScale and the contentOffset to the UIScrollView of the PDFView or any other UIScrollVeiw and at all times the two UIScrollView's have to be synchronised.

Blurry and low resolution of PKCanvasView, as overlayview from PDFView.
 
 
Q