Bỏ qua đến nội dung

Export Deck to HTML and Print to PDF

Chờ xử lý #anki #addon #export #deck #html #and #print
Unknown
25/5/2022

Cách tải addon Export Deck to HTML and Print to PDF

Bạn có thể tải addon bằng một trong hai cách sau:

Click nút Copy bên dưới để copy code vào clipboard

266464821

Sau đó mở Anki → Tools → Add-ons → Get Add-ons → Dán code → OK

Mở trang addon trên AnkiWeb và tìm mã code ở cuối trang

Mở trên AnkiWeb

Cuộn xuống cuối trang AnkiWeb, tìm dòng có mã code 266464821 và copy

11
8

Mô tả chi tiết

TLDR: SKIP DOWN AND READ #1, #2, #3. Ignore the rest.

Works with anki 2.1.45 and older. As for newer versions, I haven’t tried.


WHAT DOES THIS DO? This will let you print cards to PDF with proper formatting better than any other options I have found.

WHO MADE THIS? This is originally glutanimate’s work, but it’s no longer available and he never updated it on patreon. It has a GNU license, so it’s redistributable. I made minor changes to improve formatting.


OVERVIEW • Use this to ➥ export a deck to HTML ➥ print in chrome ➥ “save as pdf”.

• I set chrome print options to “portrait” with “minimum margins”.

• If a repeating element is super ugly in the chrome preview, you can hide it pretty easy. *Instructions below at very end.

• If the deck is large, printing to pdf may take a long time to process. If chrome struggles to print as PDF, try firefox, or export a smaller deck.

• If PDF file size is absurdly large, use acrobat pro or similar to “save as reduced size pdf” to reduce the file size (e.g. 1GB down to 40MB-100MB for a 2000 card deck). HOT TIP: When reducing the file size, set “image quality” to maximum, and set DPI to “Bicubic downsampling to 600 DPI for images above 601 dpi”. This is sweet spot on an ipad to reduce file size dramatically without pixelation or readability issues when zooming to read screenshot from PDF textbook.


USAGE: #1 The images will be missing if you don’t export the HTML file into the SAME folder anki stores images. On PC, by default that folder is here: %APPDATA%\Anki2\User 1\collection.media\ More info in documentation here: https://bit.ly/3sUdkKs or use “search everything” freeware and search for “collection.media”.

#2 From the main deck screen ➥ click the options cog wheel next to the deck you want to export ➥ click export ➥ choose “Export one-column HTML Glossary” (this is only option that works as expected!)

#3 Cards that use the following template will export correctly. If your question is repeating multiple times, make sure the template is using {{FrontSide}} and <hr id=answer> like below. Removing scripts from the card template may fix formatting issues.

Front Template: {{Front}}

Back Template:
{{FrontSide}} <hr id=answer> {{Back}}

#4 Use the “Change Card Creation Times” addon if cards are out of order on export, as that is how it orders the exported cards: https://ankiweb.net/shared/info/217650262

Below = FYI, not important. ↓ ↓ ↓ ***How To Hide Stuff: • STEP #1: Open the HTML file in chrome ➥ click… 3 dots menu ➥ more tools ➥ developer tools ➥ mouse arrow icon ➥ click the ugly thing ➥ copy the “class” name of thing you want to hide. • STEP #2: Go to file in explorer/finder, and drag it to a text editor like notepad. Insert a new line below <STYLE> exactly as follows except update the word CLASS using name from step 1: .CLASS {display:none !important;}
Save changes ➥ reload in chrome. Done.


Reviews (19)

👍 2025-12-18

Does not work on Anki 25.02.1

👍 2025-07-10

Doesn’t work :(

👍 2024-07-15

Can’t work on verson 24.06.2

👍 2024-03-28

Still work today 28 march 2024 with 2.1.54. If you have a modern version it will not work for you. On the website you can download version 2.1.54 to make it work.

👍 2024-03-08

still work today 240308T235724 with 2.1.54, however it print the whole deck, making one have to manually move card/notes around. but result is still good.

👍 2023-12-06

If you can’t get this to work on the latest version of Anki, just uninstall Anki from your PC. Then, install Anki version 2.1.45.

👍 2023-09-20

Sorry the export menu doesn’t show up anywhere for me. Anki Version : 2.1.65 (aa9a734f)⁩ Python 3.9.15 Qt 6.4.3 PyQt 6.4.0

👍 2023-06-20

if the [audio] bothers you in the Html export, find the exporter.py file in plugin source, and in the function called escapeText, somewhere along a similar looking line, (for example line 152 in my version of the file in june 2023)

type (mind the indentation, you might be better off copying another line and changing bits if you’re not technically minded) :

text = re.sub(“[anki:.*?]”, "", text)

it gets rid of anything in brackets looking like this: [anki: … ]

Korean doesn’t

👍 2023-05-31

Not working as can’t seem to find export to html option under export button. using anki 2.1.61

👍 2023-04-28

Does this work for anyone ON MAC? And if so, how/which version etc.? On the latest version (2.1.61) it does not show me the “export to HTML” option under “Export”. And when I installed version 2.1.45, I cannot install the add-on (something like “this version of Anki is too old for this add-on”. Thanks for any hints.

👍 2023-04-27

Work as expected.

👍 2023-01-06

Version ⁨2.1.54 (b6a7760c)⁩ on Win doesn’t work: cannot import name ‘decodestring’ from ‘base64’ (unknown location)

👍 2022-11-10

WOW! I spend 45 Minutes on other add-ons, which didn’t work, downloaded Anki 2.0 even though I am using Anki 2.1 . All a lot of hassle I could have avoided with finding this add-on earlier.

Thanks a lot!

👍 2022-10-25

THANK YOU I WAS ABLE TO EXPORT MY CARDS IN PROPER ORDERINGGGG IN HTML FORMATT

👍 2022-10-24

Thank you! Creates nice HTML-Files!

Note: Add a script-tag on top of your HTML-File to display Laxtex / Mathjax like described here:

https://docs.mathjax.org/en/latest/web/start.html

👍 2022-10-07

you saved my life

👍 2022-10-03

I got a lot of this as the audio

[anki:play:q:0] how to hide it.

By the way, the contact author is not for the author?

👍 2022-06-05

This works if you follow the instructions.

👍 2022-05-27

broken font (Korean pdf) T T Comment from author This is more of a local alderman or state legislature issue than Anki. 🍕