Anki add-on: Capture Deck's Cards to Images and PDF

This add-on will grab/capture the card's question and answer windows when you review the deck and write to images and a pdf： Update 2024.01.13 1: Surpport Year's type version; 2: Update GUI to a docked windows which will show the captured image of the cards, in this docked window you can seek,play,save to pdf or images. 3: NOTE!!! the qt's capture screen api will not work at Direct3D, so you must change the Anki's Video Driver to OpenGL or Software mode, this config at "Tools-Preferences-General-Video driver". 4: This addon will conflict with my another addon:1444113509. Update 20210909: 1: Fix some bugs. 2: Config setting add some new options: "scroll":{ "scroll_overlap":0.03, }, This overlap option will use scroll veiw with scrll bar for multi pages show how ratio between two pages. "export": { "pdf_pages_combine_type":0, "pdf_pages_height_min":0.1 }, The add-on supports new pdf export type: when the q&amp;a views have multi page, pdf export the pages will print as: pdf_pages_combine_type = 0: the q&amp;a views having multi page will combine to a whole pages, this was the last version option, but it dosen't look well when you use with such as kindle ebook reader, because the pages are diffrent size pdf_pages_combine_type = 1: the q&a views having multi page will keep the views when you see with the review, pdf will keep the pags same size, the pages's overlap keep with what you view in the anki's review window; pdf_pages_combine_type = 2: this type will cut the whole picture with the one page size and try to split at the blank area to avoid cut at the text show, I think this is good choice for ebook reader. Update 20210804: 1: Fix bugs about names of images and others. 2: Config setting add new options: "scroll":{ "scroll_end_gap":3, "scroll_shortcut_space": true, "scroll_shortcut_return": true, "scroll_shortcut_enter": true }, When the card has vertical scrollbar, you can use 4 shortcuts key< 'n', ' '(spacebar)，Qt.key_return, Qt.key_enter> to grab current view and scroll down the page to view new contents, when scroll to the bottom of the end, if the gap is smaller than the config set: 'scroll_end_gap', type shortcut will flip to next window. The shortcuts:<' '(spacebar)，Qt.key_return, Qt.key_enter> are the anki review's native options, if these changes cause some conflicts, you can disable them, only use the shortcut key "n" or 'Ctrl+n'. I think that shortcuts scroll down page is very useful, if you disable the capture the card to image or pdf by Tools menu, it also works except you disable this addon. Update 20210803: 1: Fix bugs for images named error and PDF toc's updation error. It will capture the question's view when you enter the answer button and capture the answer's views and write the two captrue screens to the disk for images and write the pages to the PDF. If the question or the answer window has the vertical scroolbar, you can type the shortcut "n" key to scroll page until scroll the bottom, it will grab view after type 'n'key and murge these images to one image and write to disk and pdf. it not support horizontal Scrool bar, you need zoom the main window to show all the horizontal contents. When enable capture image, the question image file's suffix name is '.jpg', and the answer image file's suffix name is '.png' The pdf file's name is the Deck's name which you are reviewing. The image file will store at the Directory with the Deck's name, for the python make a new directory has some limits, I use some codes will cause a unexpected window pop out, you just only close it, if the Directory exists, this exception will not occur again. Write to PDF need on package called "PyMuPDF", I developed this Add-on in Windows10 and I don't know how config it in Linux or other system, if you need this issue, you can try modify this add on or other ways. This add-on will use config to enable/disable the grabwindow for write them to images/pdf and also add an option to the Tools menu in the main window. it also alarms you when you review over the first answer card in the Deck and grabwindow for writes image/pdf to the disk, you can disable/enable the add-on. The config file: "export": { "path": "download", "name_index": 0, "name_field": "", "img_question": true, "img_answer": true, "pdf_question": true, "pdf_answer": true }, "pdf": { "format": "Auto" } } a. if name_index > 0 , the Add-on will write the image and pdf toc with the index increasing count b. if name_index == 0, the Add-on will use the name_field's string as the key to get the card's note field's content as the image name or pdf's toc; if the name_field string is empty, the add-on will uses the default key's field content as the name; if the Deck's cards have the same content's key, the add-on will add the card's did to the name.