danielsaidi / RichTextKit

RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
MIT License
944 stars 126 forks source link

How to get thumbnail of RichTextEditor #79

Closed Adamekka closed 1 month ago

Adamekka commented 1 year ago

I am creating a file manager and I need to get the thumbnail of the RTF file, if I use RichTextEditor I don't know how to disable user interactions with that view

PDFDocument has .thumbnail() method, but I couldn't find that method on RichTextEditor

image

e-hartig commented 1 year ago

Sounds like you might want to use something like SwiftUI's ImageRenderer that draws a view to a bitmap. https://developer.apple.com/documentation/swiftui/imagerenderer

Adamekka commented 1 year ago

thanks! I'll try it

danielsaidi commented 1 month ago

Yeah, the ImageRenderer is great for these situations.

I'm closing this since I haven't heard anything else about it in a while. Feel free to let me know if you want to reopen it.