Basic Printing Support
<10kB. Updated 2022-03-04.
The author has shared 13 other
item(s).
Description
Download
As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.
Supported Anki versions:
- 2.1.0-2.1.19 (Updated 2017-08-28)
- 2.1.20+ (Updated 2022-03-04)
To download this add-on, please copy and paste the following code into Anki 2.1:
1025789669
If you were linked to this page from the internet, please open Anki on your computer, go to the Tools->Add-ons menu item, then click on Get Add-ons and paste in the code.
All Anki 2.1.x Add-Ons Contact Author
Reviews

It puts the answer right below the question, making it useless because you can see the answer before you can try to thing about the answer.

Thank you. Works like a charm.

o meu funcionou perfeitamente. Posso selecionar o baralho que quero e pedir para imprimir. Obrigado!

worked well with my Mac!

Great add-on! A couple notes for users:
(1) If you want MathJax equations to display properly automatically without having to open Chrome developer tools, then simply change the line in the '__init__.py' code that sets the head for the html document from:
"<html><head>" + '<meta charset="utf-8">' + mw.baseHTML() + "</head><body>"
to:
"<html><head>" + '<meta charset="utf-8">' + '<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>' + mw.baseHTML() + "</head><body>"
(2) If you only want to print the question text, in '__init__.py' you can replace the line ‘qatxt = c.render_output(True, False).answer_text’ with ‘qatxt = c.render_output(True, False).question_text’. This has the added benefit of actually displaying the cloze deletion questions correctly.
(1) If you want MathJax equations to display properly automatically without having to open Chrome developer tools, then simply change the line in the '__init__.py' code that sets the head for the html document from:
"<html><head>" + '<meta charset="utf-8">' + mw.baseHTML() + "</head><body>"
to:
"<html><head>" + '<meta charset="utf-8">' + '<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script><script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>' + mw.baseHTML() + "</head><body>"
(2) If you only want to print the question text, in '__init__.py' you can replace the line ‘qatxt = c.render_output(True, False).answer_text’ with ‘qatxt = c.render_output(True, False).question_text’. This has the added benefit of actually displaying the cloze deletion questions correctly.

Great

Works really well thanks.

it works! would be better if there's a script or an option to changed how it's arranged, like according to how i created my cards and not alphabetically (or sequentially)

Nice Addon!
Is it possible to show Cloze Cards as 1 Card and not as multiple?
Is it possible to show Cloze Cards as 1 Card and not as multiple?

Out of a couple of Anki add-ons for printing that I tried, this one was the closest to working. However, it still failed to deal with anything but basic cards, and even then, many basic cards were broken.

To the user who posted on 26/09/2022: THANK YOU. You rendered all my Mathjax.

Excellent for sharing notes with those who does not use Anki.
It does not work with cloze deletion.
If you want to use MathJax open Google Chrome, go to Developers tools then Console and paste this code:
function loadScript(src) {
var script = document.createElement("script");
script.src = src;
document.body.appendChild(script);
}
loadScript("https://polyfill.io/v3/polyfill.min.js?features=es6");
loadScript("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");
It does not work with cloze deletion.
If you want to use MathJax open Google Chrome, go to Developers tools then Console and paste this code:
function loadScript(src) {
var script = document.createElement("script");
script.src = src;
document.body.appendChild(script);
}
loadScript("https://polyfill.io/v3/polyfill.min.js?features=es6");
loadScript("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");

Fantastic!!! That's just what I was lloking for to get all my decks on paper and study offline

Great for sharing cards to people who don't use anki

Just what I needed

It worked as expected.
If you're having trouble with alignment, you can change it in the "__init__.py" file. Just replace "<center>{0}</center>" by "<left>{0}</left>" on line 70.
If you're having trouble with alignment, you can change it in the "__init__.py" file. Just replace "<center>{0}</center>" by "<left>{0}</left>" on line 70.

Can't find the sign for doing this on tools. For some reason, it is not appearing.

So, this works wonderfully, way better than the Cards to Paper or however it was that name. The only issue is that it prints ONLY the BackSide. But I managed to find a way to obtain FrontSide and BackSide separetely to print them one on one side of the paper and the other one on the other one.
The idea is creating two htmls (printed to PDF), one for each side. Fiddle with the styling to make both the Front and Back Side of the same height when you print the PDF. After a few tries, I've understood that it does not matter the font size of the lines, but how many lines there are.
I'll explain myself: I wanted this to print a few of the RTK cards for Japanese; the problem was that the backside (the kanji one) outputted circa 9 rows per page if I just wrote the kanji and a single line of info about strokes and so, WHEREAS with the front side, where I wanted only the keyword, no matter how big I set it, the single line was resized by Firefox when printing to PDF.
Therefore, the solution was to add a couple extra lines to make the resize work. Also, if you put one line too big over the other ones, Firefox will resize the cards anyway, and you'll have the same problem, so the lines must be of similar dimensions, especially Latin characters. If you fiddle with it, you'll understand what I mean.
I know it's no final solution, but I wanted to share what has worked for me.
The idea is creating two htmls (printed to PDF), one for each side. Fiddle with the styling to make both the Front and Back Side of the same height when you print the PDF. After a few tries, I've understood that it does not matter the font size of the lines, but how many lines there are.
I'll explain myself: I wanted this to print a few of the RTK cards for Japanese; the problem was that the backside (the kanji one) outputted circa 9 rows per page if I just wrote the kanji and a single line of info about strokes and so, WHEREAS with the front side, where I wanted only the keyword, no matter how big I set it, the single line was resized by Firefox when printing to PDF.
Therefore, the solution was to add a couple extra lines to make the resize work. Also, if you put one line too big over the other ones, Firefox will resize the cards anyway, and you'll have the same problem, so the lines must be of similar dimensions, especially Latin characters. If you fiddle with it, you'll understand what I mean.
I know it's no final solution, but I wanted to share what has worked for me.

good addon, but how to change the alignment to left, the origin alignment is middle

Love it. Would also love the ability to decide the grid for each page (currently about 3 in landscape and 6 in portrait) would maybe prefer 2 in landscape.

I love the add-on. It is great and exactly what I need. However, I am struggling with modifying the .py-script in a way that my cards are sorted columnwise instead of rowwise. I.e., instead of [[1,2,3],[4,5,6],[7,8,9],[10,11,12]], I would like to have it [[1,5,9],[2,6,10],[3,7,11],[4,8,12]]. Does anyone know how to deal with this?

Exactly what I was looking for :)

Thank you so much!
Feedback: Everything works fine, and it is especially nice since there are few alternatives. Though, for it to be more useful it would require the possibility to print the cards in the order added and/or by tag - not in alphabetical order since this is random and essentially shuffles the cards without the user wanting them shuffled.
Feedback: Everything works fine, and it is especially nice since there are few alternatives. Though, for it to be more useful it would require the possibility to print the cards in the order added and/or by tag - not in alphabetical order since this is random and essentially shuffles the cards without the user wanting them shuffled.

Works well for me - thanks a lot :-)

the print it not to scale. it will not print to page margin

it does work but it prints the front and back on one single flashcard which makes the flashcard a lot less efficient for active recall. Don't bother downloading this.

does not do the job needed to .. which is question at back and answer at front .. or vice versa .. it just prints everything on one card .. and about 9 card on one paper

Pretty good, but I wish it had more options like only showing cloze-type notes once, rather than having them repeat for each card.
Once you export the print file though, you can simply use HTML editing to reformat, but its kind of tedious.
Once you export the print file though, you can simply use HTML editing to reformat, but its kind of tedious.

Good, but it'll be better if we can print some specific cards, like that I studied only today.

Thanks

Thank you so much!
Simple and elegant.
I printed a 3,000-item deck with different note types in the mix, and that has no images, and it looks great.
Simple and elegant.
I printed a 3,000-item deck with different note types in the mix, and that has no images, and it looks great.

Looks really good and works with Anki 2.3x. The problem is that if you print then you are going to need all of the cards the same size. When I wanted to print the page loaded without problems. It loaded 3500+ cards of all different sizes unfortunately. I imagine this is due to this being a very basic add on, it only renders well if the card is a basic card. I haven't tried basic cards and it may be possible that, depending on the length of the answer, the cards might also expand and shrink for printing. Great add-on, just too basic.

Very helpful thx

Worked perfect on the first try

Very nice!
But I would like to ask if it is possible that it can be limited to showing one card per page (having a new page after each card)?
Thank you!
But I would like to ask if it is possible that it can be limited to showing one card per page (having a new page after each card)?
Thank you!

Works brilliantly! Thanks!

Great!! Thank you

This works great! I was able to render LaTeX formulas by pasting this into the browser console:
```
function loadScript(src) {
var script = document.createElement("script");
script.src = src;
document.body.appendChild(script);
}
loadScript("https://polyfill.io/v3/polyfill.min.js?features=es6");
loadScript("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");
```
```
function loadScript(src) {
var script = document.createElement("script");
script.src = src;
document.body.appendChild(script);
}
loadScript("https://polyfill.io/v3/polyfill.min.js?features=es6");
loadScript("https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js");
```

Really good, but it would be great if there where more possibles to custumize the output. For example, linesize and color of the box, Backgroundcolor of the hole page and Backgroundcolor of the box.

Great!

does what it says on the tin
doesn't display LATEX or clozure, but images worked for me (no image addons)
doesn't display LATEX or clozure, but images worked for me (no image addons)

Does anyone know how to get the images to not appear as [?] ???

good!

It works. It also supports Unicode.
Version 2.0.32
Version 2.0.32

Superb! Better than other addons for printing. Highly recommended.

The only thing that I miss, is that it doesn't work properly with Image occlusion Enhanced. If anyone has a solution, write that down here please!

can someone tell me how to change alignment from center to left? simple but effective app!

It works!

Does not work

Incompatible with cloze deletion or image occlusion

I follow the steps, it worked. Thanks!

I hope it supoort more cutomized option for layout.
now it only support card per row.
sometimes i want it just one card per a page.
Thank your for your all the effort! I really get the best of it.
now it only support card per row.
sometimes i want it just one card per a page.
Thank your for your all the effort! I really get the best of it.

✅ Update 24.02.2020: Damien fixed it now. Thanks! ✅
༼ つ ◕_◕ ༽つ 🆘 Fix for Anki 2.1.20: 🆘
1. Open the "__init__.py"-file of this addon in a text editor. You can find this file by clicking on Extras > Addons, selecting "Basic Printing Support" in the list on the left and clicking the "Show Files"-button on the right.
2. Go to Line 57. It says: qatxt = c._getQA(True, False)['a']
3. Replace this with: qatxt = c.css() + c.render_output().answer_text
4. Save the changes to this file.
5. Restart Anki.
Voila! Printing works again.
༼ つ ◕_◕ ༽つ 🆘 Fix for Anki 2.1.20: 🆘
1. Open the "__init__.py"-file of this addon in a text editor. You can find this file by clicking on Extras > Addons, selecting "Basic Printing Support" in the list on the left and clicking the "Show Files"-button on the right.
2. Go to Line 57. It says: qatxt = c._getQA(True, False)['a']
3. Replace this with: qatxt = c.css() + c.render_output().answer_text
4. Save the changes to this file.
5. Restart Anki.
Voila! Printing works again.

simply does not work!

Thank You

For those who are new to installing add-ons: restart Anki, the menu item won't show up until you do.
For some reason some of my MathJax formulas do not get rendered in the output. Otherwise looks good.
For some reason some of my MathJax formulas do not get rendered in the output. Otherwise looks good.

So useful, thanks!

Just save

OK

Very useful and easy to use. Sometimes I need a PDF file just to review my cards.

thank you so much. works great for me with some additional tweaks

It really work.help me a lot!!!Thank u!!!

Thank you. Everything works!)

Reasonably good hack (almost does what I want it to do) but... it's definitely _basic_ support. Problems include:
* It only prints the back side of the cards, meaning that (e.g.) cloze deletion cards do not properly function.
* They're in a fixed grid, meaning you can't (for example) print the cards on different-sized paper or have the individual cards have a different width. (Possible to partially fix: you could use Anki's new add-on configuration system to pick values for the `CONSTANTS`, allowing the user to change the cards-per-width.)
* Printing multiple times overwrites the previous printouts. (Possible to fix: use a temporary file or simply write to `"path/print"+repr(time.now())+".html"`, or perhaps prompt the user for where to save.)
* CSS is discarded. (Could be fixed using Shadow DOMs, but that's a really complicated feature.)
* Key combination Ctrl + P clashes with Preferences, rendering neither operable. (Possible to fix: choose something else, like Ctrl + Shift + P, or at least disable the key combination.)
But it does what I need it to (almost) and that's good enough for me until I have time to make an "Advanced Printing Support" addon.
* It only prints the back side of the cards, meaning that (e.g.) cloze deletion cards do not properly function.
* They're in a fixed grid, meaning you can't (for example) print the cards on different-sized paper or have the individual cards have a different width. (Possible to partially fix: you could use Anki's new add-on configuration system to pick values for the `CONSTANTS`, allowing the user to change the cards-per-width.)
* Printing multiple times overwrites the previous printouts. (Possible to fix: use a temporary file or simply write to `"path/print"+repr(time.now())+".html"`, or perhaps prompt the user for where to save.)
* CSS is discarded. (Could be fixed using Shadow DOMs, but that's a really complicated feature.)
* Key combination Ctrl + P clashes with Preferences, rendering neither operable. (Possible to fix: choose something else, like Ctrl + Shift + P, or at least disable the key combination.)
But it does what I need it to (almost) and that's good enough for me until I have time to make an "Advanced Printing Support" addon.

+1

lovely, allows me to drag my anki decks into onenote for extra mischief.
you complete me.
you complete me.

doesn`t work

To get the cards in order you created them, go to the addons window, click "open folder", open __init__.py, go to line 24 and in the triple """, replace 'sort by n.sfld' by 'sort by c.id'

Works fine!

it worked for me

Can somebody please explain how to install this printing add-on on Mac computer?

Perfect, much needed. I was able to replace OneNote with flashcards because of this.

Not appearing on Safari Browser Anymore
The print option was working fine, but now when I try this add-on the lightbulb appears on the bottom left corner of Anki, but my browser never opens a new tab for printing my cards. Please help! It was working well before, and now it just doesn't work for me
The print option was working fine, but now when I try this add-on the lightbulb appears on the bottom left corner of Anki, but my browser never opens a new tab for printing my cards. Please help! It was working well before, and now it just doesn't work for me



Updating Print Settings for cleaner printing
To stop printing from cutting off tables in mid-row and to make the columns a consistent width you can edit this plugin and replace the following lines.
REPLACE:
tr { page-break-after:auto; }
WITH:
tr { page-break-inside:avoid; page-break-after:auto }
REPLACE:
cont = u"<td><center>%s</center></td>" % esc(c._getQA(True, False)['a'])
WITH:
cont = u'<td width="{1}%"><center>{0}</center></td>'.format(esc(c._getQA(True, False)['a']), 100/CARDS_PER_ROW)
To stop printing from cutting off tables in mid-row and to make the columns a consistent width you can edit this plugin and replace the following lines.
REPLACE:
tr { page-break-after:auto; }
WITH:
tr { page-break-inside:avoid; page-break-after:auto }
REPLACE:
cont = u"<td><center>%s</center></td>" % esc(c._getQA(True, False)['a'])
WITH:
cont = u'<td width="{1}%"><center>{0}</center></td>'.format(esc(c._getQA(True, False)['a']), 100/CARDS_PER_ROW)

HowTo get Pictures into MS Word
1) Open print.html in Internet Explorer
2) File->Save As "Webpage" under new name (Internet Explorer will create a html file and a folder containing the pictures
3) Open saved .html-file in Chrome
4) CTRL+A -> CTRL+C into Word.
( 5) In Word get rid of the tables and replace them with paragraph marks)
1) Open print.html in Internet Explorer
2) File->Save As "Webpage" under new name (Internet Explorer will create a html file and a folder containing the pictures
3) Open saved .html-file in Chrome
4) CTRL+A -> CTRL+C into Word.
( 5) In Word get rid of the tables and replace them with paragraph marks)

Still works OK
This is very basic, but it works.
As other reviewers mention, it would be great if it auto-loaded the exported html page in a browser.
This is very basic, but it works.
As other reviewers mention, it would be great if it auto-loaded the exported html page in a browser.

Addon needs an update
Generating the print.html works for me but some points:
1. It opens to C:\Users\xxxxx\AppData\Roaming\Anki2\addons and not to the documents folder.
2. It does not open the print.html in the browser.
Generating the print.html works for me but some points:
1. It opens to C:\Users\xxxxx\AppData\Roaming\Anki2\addons and not to the documents folder.
2. It does not open the print.html in the browser.

Does spawn brower, does not generate output file for printing, pretty shoddy

print option
money. works fast. can convert from webpage to PDF and print away. sweet!
money. works fast. can convert from webpage to PDF and print away. sweet!

Doesn't output to webpage
When I select the deck and then use the add-on, it tells me it is working, but doesn't ever output to a webpage for viewing and printing.
I'm running windows 10 and Anki Version 2.0.41, thoughts? I would really like to see this work.
When I select the deck and then use the add-on, it tells me it is working, but doesn't ever output to a webpage for viewing and printing.
I'm running windows 10 and Anki Version 2.0.41, thoughts? I would really like to see this work.

great support
highly recommended
[url=http://www.hello.com]hello[/url]
http://www.hello.com
<a href="http://www.hello.com">hello</a>
[url="http://www.hello.com"]hello[/url]
highly recommended
[url=http://www.hello.com]hello[/url]
http://www.hello.com
<a href="http://www.hello.com">hello</a>
[url="http://www.hello.com"]hello[/url]


Please fix page breaks and dramatic variations in card height
Great add-on, but definitely needs some fixing
Great add-on, but definitely needs some fixing

Page breaks destroy the experience
Hi, thanks for this addon. I really like it and think it's great.
Unfortunately I have 2 big problems with it:
1. the flash cards I want to print are different in hight because of different amount of text on it. So they won't fit on a page without the half of one card continuing on the next... I didn't find a way to fix that in the Browser, yet.
2. to fix the problem from 1. I tried to open the print.html in excel and set the print margins for each row manually. But Latex Formulas weren't imported into excel. This makes it very impractial for my purposes :/ (running Mac OSX)
Any Ideas?
Hi, thanks for this addon. I really like it and think it's great.
Unfortunately I have 2 big problems with it:
1. the flash cards I want to print are different in hight because of different amount of text on it. So they won't fit on a page without the half of one card continuing on the next... I didn't find a way to fix that in the Browser, yet.
2. to fix the problem from 1. I tried to open the print.html in excel and set the print margins for each row manually. But Latex Formulas weren't imported into excel. This makes it very impractial for my purposes :/ (running Mac OSX)
Any Ideas?


this is how you can modify the script so that it will open the Browser Windows
for me it didn't open the browser window.
I managed to resolve it by editing one line in the script (Tools --> Add-ons --> Basic_Printing_Support --> Edit..
replace "openLink(upath(path))" with "QDesktopServices.openUrl(QUrl.fromEncoded(upath(path)))" and then restart anki and print. It works for me
for me it didn't open the browser window.
I managed to resolve it by editing one line in the script (Tools --> Add-ons --> Basic_Printing_Support --> Edit..
replace "openLink(upath(path))" with "QDesktopServices.openUrl(QUrl.fromEncoded(upath(path)))" and then restart anki and print. It works for me


Thank you Thank you Thank you!
It automatically opened in Chrome on my Mac and then I copied the cards into Word :)
It automatically opened in Chrome on my Mac and then I copied the cards into Word :)

Niektóre tale dobrze zamienia na nadające się do druku (głównie słówka). Jeżeli chodzi o rozbudowane talie, ze zdjęciami, kilkoma elementami, występują problemy. U mnie brakuje widoku przedniej strony fiszki w wydruku.

brilliant app
works perfectly for me... when the output file first opened automatically in firefox i wasn't really satisfied as the characters were tiny and about 100000 cards were crammed into one page, but opening it in safari did the trick for me. also i tried word, but unfortunately no pictures were displayed there.
works perfectly for me... when the output file first opened automatically in firefox i wasn't really satisfied as the characters were tiny and about 100000 cards were crammed into one page, but opening it in safari did the trick for me. also i tried word, but unfortunately no pictures were displayed there.

has problem
add-on changes the order of words.
all the flashcards are not the same (Length and width).
add-on changes the order of words.
all the flashcards are not the same (Length and width).



Genius!
Works perfectly, a little slow but awesome, thanks!
Works perfectly, a little slow but awesome, thanks!




Great add on
Works as it says on the box. Thanks heaps.
Would love a way to select less than a whole deck, i.e. export to the print file just tag=something.
Thanks.
Works as it says on the box. Thanks heaps.
Would love a way to select less than a whole deck, i.e. export to the print file just tag=something.
Thanks.


Very useful
Very useful.
Thank you very much :)
Very useful.
Thank you very much :)


Change print order
Currently the cards are sorted in alphabetical order. Is it possible to add settings to print in order of date created? Or in the card order?
Currently the cards are sorted in alphabetical order. Is it possible to add settings to print in order of date created? Or in the card order?

WORKS, but does not open the browser automatically.
All of you who are saying this add-on does not work: it does. It just doesn't open the browser automatically.
Here's how to do it (Windows):
1. After printing the deck, head to file:///C:/Users/[Username]/Documents/Anki/[Anki username]
2. Here you'll find a file called "print.html". This is the file with your deck.
3. Open the file with your browser and you're good to go.
If your flash cards contain special letters and you end up with weird symbols within the deck, install a free software that allows you to convert the file into, for example, UTF-8. I used Notepad++ (http://notepad-plus-plus.org/). With Notepad++, the file can be converted through "Encoding -> Convert To...". After that just save the file and re-open it with your browser. Now the weird symbols should be gone.
All of you who are saying this add-on does not work: it does. It just doesn't open the browser automatically.
Here's how to do it (Windows):
1. After printing the deck, head to file:///C:/Users/[Username]/Documents/Anki/[Anki username]
2. Here you'll find a file called "print.html". This is the file with your deck.
3. Open the file with your browser and you're good to go.
If your flash cards contain special letters and you end up with weird symbols within the deck, install a free software that allows you to convert the file into, for example, UTF-8. I used Notepad++ (http://notepad-plus-plus.org/). With Notepad++, the file can be converted through "Encoding -> Convert To...". After that just save the file and re-open it with your browser. Now the weird symbols should be gone.



si la pagina web no abre automaticamente
debes ir a C:\Users\....\Documents\Anki\usuario 1, alli debe existir un archivo html con las tarjetas listas para imprimir
debes ir a C:\Users\....\Documents\Anki\usuario 1, alli debe existir un archivo html con las tarjetas listas para imprimir

Browser does not open
Unfortunately, the web page does not open after counting all cards in the deck. Is there a special thing I need to do to view them?
Unfortunately, the web page does not open after counting all cards in the deck. Is there a special thing I need to do to view them?