uxmstudio / UXMPDFKit

An iOS PDF viewer and annotator written in Swift that can be embedded into any application.
MIT License
274 stars 104 forks source link

Does not save last annotation #69

Open amrit42087 opened 7 years ago

amrit42087 commented 7 years ago

I am using your library in one of my projects. I am unable to render all the annotations onto the pdf. Lets say I first selected pen annotation and I drew my signatures. If I then call renderOntoPDF() method, the psd won't be saved with my signatures. Now lets say I first selected pen annotation and drew my signatures. Now I again selected text annotation and wrote some text on to the pdf. This time only signatures would be rendered on calling renderOntoPDF() method. Both the annotations won't be saved. As an extract, last annotation is not saved. This also happens with the demo project on github. Can you please help me out with this issue. I am about to launch my application. I am only left with this issue.

Here is the video: demo.zip

pushchris commented 7 years ago

@amrit42087 what version of the framework are you using as well as who version of iOS? Thanks.

amrit42087 commented 7 years ago

Its the latest version. I installed it using the following command: pod "UXMPDFKit" My iOS version is 10.3.2

pushchris commented 7 years ago

@amrit42087 you'll need to close out of the current annotation and save it before rendering it. An active annotation is still pending save. When you leave the annotation controller it should automatically do this, see: https://github.com/uxmstudio/UXMPDFKit/blob/9722770fb7dd6bfbe96a6ab9d9dde64db0e4dd4b/Pod/Classes/Renderer/PDFViewController.swift#L159-L161

If you are overriding PDFViewController you will want to make sure to call these methods manually.