PDF interaction with Swift

Viewed 52

I want to display a PDF and make the user interact with it. Specifically I want:

  • Show a PDF
  • That the user can click on the PDF (with long tap for example) and add a mark. I want this mark to be a personalized image.
  • Capture the event when a user taps on one of these marks.
  • I want these marks to be recoverable. That is, I want to recover the pdf coordinates where these marks are to be able to save them and retrieve them at another time.

I have looked for solutions like PDFTron or PDFKit but I can't find the way to satisfy these requirements. Is there any way to satisfy this requirements with these solutions or other solutions?

Thanks

1 Answers

Assuming that you are talking about iOS Development in Swift, I have used these libraries before and I would definitely recommend these:

Open Source:

  1. LazyPDFKit
  • Show a PDF ✅
  • Supports Basic PDF annotation (But no image) ✅
  • Event Listener/Delegate ✅
  • Recoverable/Undoable ✅
  1. TPPDF
    • Show a PDF ✅
    • Supports Basic PDF annotation ‍♂️
    • Event Listener/Delegate ✅
    • Recoverable/Undoable ✅

However, if you have some money to spend:

  1. PSPDFKIT
  • Everything related to PDF ✅

P.S. If you just need to annotate a PDF PDFDrawingView would be enough.

Related