Anki add-on: Export Deck to HTML and Print to PDF

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.