Generating card preview images

I’m building an add-on that needs to programmatically generate image previews of card contents, the same as Anki’s standard preview.

I’ve tried using the Preview class and QWebEngineView, but have gotten neither to work properly. That being said, I think the approach using the existing Preview class is most promising.

How doe’s one use Anki’s built-in preview rendering from within add-on code? I essentially need to generate the preview images on demand.

Any suggestions on how to achieve this would be greatly appreciated!

Wouldn’t the add-on Editor Live Preview be helpful?


It could indeed!

Thank you!

I was able to adapt the code from there :white_check_mark:

1 Like