Juma Orido
Juma Orido

Reputation: 491

How to Save/Show PDF Highlight Annotations in Swift

I am successfully highlighting text in my PDF view using the answer in this question.

However, whenever I close and reopen the PDF file, the highlight annotations are nowhere to be seen (invisible).

How do I save and/or display the highlights?

Thanks in advance for helping a noob!

Upvotes: 1

Views: 1048

Answers (1)

steipete
steipete

Reputation: 7641

Check out the write operations on PDFKit: func write(toFile path: String) -> Bool

If you're using PSPDFKit, saving happens automatically based on certain trigger criteria (like moving an app into the background) but you can manually trigger it via calling public func save(options: [SaveOption] = []) throws on PSPDFDocument.

Upvotes: 1

Related Questions