25 22
Contact Author Sign in to rate

Papercards - export & print flashcards to paper

0.01MB. Updated 2021-05-14.

Description

What is Papercards? Papercards is an exporter for your cards. It saves the cards to HTML or PDF and then you can print them on paper. Quick Start
  1. Install the plugin
  2. Restart Anki
  3. Go to a carddeck, which should be exported
  4. Select Tools->Export to papercards
  5. Print the exported file.
Requirements Configuration
  1. Open Anki's menu Tools->Add-ons
  2. Select Add-on Papercards
  3. Click on Config button on the right side
  4. Read and scroll through the infobox at the top part for available options
  5. Change the desired JSON value.
Issues Cannot find command wkhtmltopdf Please use the review section only for feedback. I cannot give you any response here. Issues can be reported in this form

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:

To download this add-on, please copy and paste the following code into Anki 2.1:

2042118948

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

All Anki 2.1.x Add-Ons Contact Author

Reviews

on 1655384905
It does need some configuring, but works well. Printed beautiful cards as a gift.
on 1652296303
didnt work out of the box. tried with all other add-ons disabled.
installed wkhtmltopdf. still no luck

Debug info:
Anki 2.1.49 (dc80804a) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-05-11 23:19:09

Caught exception:
Traceback (most recent call last):
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\main.py", line 38, in export_papercards
papercard.export_paper(deck, cards)
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 311, in export_paper
htmlfile, pdffile = self.generate_paper(deckname, cards)
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 281, in generate_paper
content = self.arrange_cards(cards)
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 191, in arrange_cards
html += self.build_answer_card(answers[j])
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 149, in build_answer_card
a = re.sub('(<img.*? src=")(.*?)(".*?>)', self.replace_image_source, a)
File "C:\python\lib\re.py", line 210, in sub
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 156, in replace_image_source
if imagefile.exists():
File "pathlib.py", line 1391, in exists
File "pathlib.py", line 1197, in stat
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'https:\\p.kindpng.com\\picc\\s\\122-1225463_patreon-new-patreon-logo-transparent-hd-png-download.png'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\main.py", line 45, in export_papercards
raise Exception(msg).with_traceback(sys.exc_info()[2])
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\main.py", line 38, in export_papercards
papercard.export_paper(deck, cards)
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 311, in export_paper
htmlfile, pdffile = self.generate_paper(deckname, cards)
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 281, in generate_paper
content = self.arrange_cards(cards)
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 191, in arrange_cards
html += self.build_answer_card(answers[j])
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 149, in build_answer_card
a = re.sub('(<img.*? src=")(.*?)(".*?>)', self.replace_image_source, a)
File "C:\python\lib\re.py", line 210, in sub
File "C:\Users\iaare\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 156, in replace_image_source
if imagefile.exists():
File "pathlib.py", line 1391, in exists
File "pathlib.py", line 1197, in stat
Exception: Papercards Plugin Exception (V:21.05
)
<class 'OSError'>: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'https:\\p.kindpng.com\\picc\\s\\122-1225463_patreon-new-patreon-logo-transparent-hd-png-download.png'
on 1651471161
Didn't work out of the box.
Requires going into the HTML, converting manually from HTML -> PDF, flipping every other page so that the lines actually match up.
That stuff is no problem.

I had an issue w/ the content being cut off if it's more than a certain amount of characters. Can we come up w/ a solution for this?
on 1648680798
Doesn't export pictures to the pdf, only their media paths.
on 1645014318
In default landscape mode, I couldn't get my printer to correctly align front and back of the cards. However, portrait mode works fine and even gives the right format if you change the row/column settings:

"paper": {
"cardsPerCol": 8,
"cardsPerRow": 4,
"format": "A4",
"orientation": "portrait"
}
on 1644747730
It simply doesn't work. Likely an issue with wkhtmltopdf
on 1642626831
Doesn't work. The back of the cards don't export at all. Each card looks something like this (the Kanji & Kani is the front of the card):


(しゅう)

[[type:Back]]
on 1642443065
If you use the pdf converter in the config i found it doesn't work but after some playing around, this is what worked for me!

Add the add on, but turn the "pdf converter" section in the config to false, change padding to 30, keep A4, portrait, and make it 2 x 2 columns/rows.
Save those config settings, select the deck, then use the add on so it creates the html file. I wanted my paper document to be essentially a list of the questions and answers combined in one document, rather than typical flashcards with the answer on the back and question on the front, so I turned the "show question with answer" setting in the config to "true".

Go to the HTML file it produces, then "inspect" and go to the "<head>" section, then "<style>" section.

Because I only wanted a list of questions + answers, not typical flashcards, I deleted all the "page A"'s in the "elements" section of the inspect page so that all the plain question cards were deleted and i was left only with Page B that shows question + answer.

Within the <style> element, I changed "height" under "html, body, .pageA, .pageB" to 90%, left width at 100%. I changed text size to 75%. I made images 45% height, 50% width

I saved the edits to the elements with Command + S and then used an HTML to PDF converter website to make that edited HTML doc a pdf.

I had about 320 cards on 79 pages and the edits in the "inspection" in chrome made it so i had 2x2 (4 cards total) per page showing question and answer.

If you just want typical flashcard type style, I would make the config settings in anki 2 cards per row, 1 card per column so that the question is in 1 column, answer is in the other column, and those two cards are in the same row on 1 page.

I'm sure fiddling with the "inspect" feature in chrome or whatever browser you have will allow you to make changes to the sizing, margins, padding, etc. so that it fits your needs.

Have to make the changes under the <head> <style> part of the inspect window or it won't save/make permanent changes to the HTML that will show up in your converted PDF. I'm no tech wiz by any means so it took me forever to realize why simply deleting or changing things in the elements under <body> wasn't showing up as permanent changes to the HTML file once I saved and opened it numerous times.

I hope this helps and made sense.

This works for columns x rows: 1 x 1, probably 1 x 2, and 2x2. Does NOT convert to PDF well in 3 x 3 or larger, so just keep that in mind.
on 1641208232
Didn't work even though I had wkhtmltopdf installed, but the ability to export to html is a great feature, since it allowed me to changed some export settings through Firefox's pdf export feature (zooming).

Thanks for this extension!
on 1639221722
Just didn't work.
on 1630329617
I tested the plugin with Anki 2.1.44 with cards that uses images and MathJax for both HTML and pdf. Here are the comments when i run under Ubuntu 20.04 LTS:
- Good results with both HTML and PDF
- Be careful to add the package 'mhchem' in the "Tools|Manage Note Types" options to render MathJax Chemistry formulas enclosed in [latex]...[/latex] tags of Anki fields (ex \usepackage{amssymb,amsmath, mhchem} for the note type you re using). I also note checking the "Create scalable images with dvisvgm" checkbox gives better results.

When i run under Window$ 10:

- Good results with HTML, applying the same settings as Linux distro for MathJax Chemistry
- PDF doesn't work for me. The problem seems to be located in the "wkhtmltopdf" utility. Indeed running it manually in the command line with the same parameters as those in the code of the plugin revealed the same conversion problem (overlap of columns, and column content). Hope for W$ users this issue can be examined.

Bugs i found:

- svg base64 encoded images in the plugin do not displays in the browser with html generated papercards.

To fix this, just add the following lines in the "def replace_image_source()" of "Papercard.py" after line 160 :

if ext == 'svg':
ext = 'svg+xml'

I also noted a great improvement of the quality of papercards with this modification

Note: I also found that sometimes characters are cropped above and below when rendered with MathJax Chemistry. However this is not a bug of the papercard add-on. Indeed the issue also appears in the card preview of Anki. Read more in my comment (dated 2021-08-30 for the related add-on "937148547 Edit LaTex build process" ) about the "--exact-bbox" parameter of dvisvgm to remediate this issue.
on 1629298738
PDF: the content of all cards is in the 1st column although 4 columns were asked. The workaround of putting 1 row and 1 column will just use tons of paper --> useless
HTML: Chemistry is displayed as code, not formula --> useless
Never got an answer.
on 1629049526
Guys!!!

If it is not working for you then do this

*****Change papercard config******

"cardsPerCol": 1,
"cardsPerRow": 1,
"format": "A4",
"orientation": "portrait"

*****Open Html in firefox*****

use firefox reader mode (Ctrl+Alt+R) to simplify text

*******Ctrl+P******

*Use Paper A5
*Scale "78" or your own preferred zoom
*margins
Custom
TOP: 0.5 , BOTTOM : 0.5
RIGHT: 0.0 ,LEFT: 0.0
and voila, there you have it
perfect print
on 1627915051
Seems to work fine, with both pictures and text.

For the average user;
It seems that if you reduce the number of cards per page (2 for example), the text will be shown more as a whole.
It also seems to work best with less information flashcards; i.e. less text in both question and answer. This is valid since flashcards works better when in high amounts rather than being long books.

However, as feedback for the creator;
Personally I would've liked if there was some way of making sure that text is not cut off due to the formatting.
As flashcards goes, I'm more interested in having the questions and text as a readable, printable source material rather than flashcards itself since anki is already more than capable of delivering it.
on 1627046948
Does not work
on 1624537976
Perfect with html.
If you have pictures that don't fit, delete all the "height: 100%;" commands in the style section of the page, but keep the "max-height: 100%;" as a style command for "img".
on 1621864133
My cards contain often up to 7 enumerations which are cut-off on the HTML cards
Also images are cut-off on the HTML cards making the cards useless
The PDF export writes everything multiple times over the same card.

I am using the Image Occlusion and Cloze Overlapping plugins.
on 1616939672
Doesn't really work if you have images. They end up being all over the place.
on 1615637703
Thanks!!
on 1615503547
Works fine in general.
Just a little feedback. I think it would be good to also insert an option to add some CSS style using the config file, because then it would be possible to adjust the size of images (also images should in general be resized to max-width of the page's width).
Another thing that would be great would be an option that disables the "newpage" divs inside the HTML so the cards are just put out without a pagebreak (maybe even without the "front side" <-> "back side" manner of writing it into the HTML file), because I didn't really need the PDF to study with the cards but rather as an overview over my noted down questions and answers.

Apart from that, great tool!
on 1614643233
It does not work. There is no option to convert the card to PDF.
on 1610754718
In principal a great idea. Id love for this to work for cards with pictures, but as it stands right now its almost unusable once there are pictures involved.
on 1610559680
Cards with images and prints become a total mess. I was hoping it would just put one thing below the other. But it probably works for simpler decks.
on 1608542768
Error message 'Cannot find command wkhtmltopdf'
on 1608220550
The pictures of the flashcards overlap eachother and obscure the information on the next flashcard.
Requires more development to superimpose the images to fit in their designated space and not overlap the other flashcard's space on the table.
It is so close to being perfect in terms of its purpose and function but this issue is detrimental and needs addressing as soon as possible.
on 1605475712
The intention seems great since it takes both the front side and the back side of the cards and place it taking in count the rows and columns specified.
It also place it in mirror for recto and verso.
But this add-on does not manage correctly the images since it does not resize it to match the dimensions of a table cell. So images are truncated.
Most of all on one face, images are centered whereas on the other face their are left-align.
It's a pitty because I'm sure this add-on just lacks a bit more devlopement to be absolutely great. Thanks to the developer.
on 1605349438
OMG thank you very much
on 1605319209
Funciona de maravilla, muy buen aporte muchas gracias
on 1602213654
If you format 1 for each setting instead of 4, it actually works alright but nothing perfect
on 1600868872
perfect
on 1586828094
Great work!!! very helpful!!!
It will be great if I can config the fields. For example, sometimes I just want to export the questions with no answers.
on 1583354674
Works!
on 1581289442
I want to export my flashcards to paper and I do not understand the process. It is very difficult :(
Where can I download papercards?
on 1579100170
whoa
on 1578413686
Very good addon ! It helps a lot to review the whole lesson at the end of the year.

Since I had lots of pictures the initial settings didn't work for me and I had to change the "cards per row" to 1 so that I could see all the pictures properly. (not on top of the text of the other cards)

I didn't need all the "front" of the cards and I didn't find how to remove them, so I changed "cards per col" to 200 so that they all appeared at the top of my pdf and I only used the second half of the pdf. If anyone knows how to delete the "front" part of the cards from the export, I'd be interested :)
on 1576092069
I think it is necessary to install pyqt5 library for PDF creation to work. Nevertheless, I found some images are cropped in my cards.
on 1574874632
Add this code to <head> to enable mathjax

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
on 1573234194
Some MathJax blocks are not rendered in the output.
on 1567922837
It is not working
on 1566131291
错误
有一个错误发生了.请在按住shift键的同时启动Anki,这样可以临时的忽略掉你已经安装的插件。
如果仅仅是因为插件引起的问题,请选择工具>插件菜单项来将出错的的插件设置成失效,然后重启Anki,重复以上的步骤直到你发现了具体是哪个插件引起的问题。
当你已经发现是因为插件引起的问题,请在我们的支持网站上 add-ons section 上报告问题。
调试信息
Anki 2.1.13 (3ba55990) Python 3.6.7 Qt 5.12.1 PyQt 5.11.3
Platform: Windows 10
Flags: frz=True ao=True sv=1

Caught exception:
File "C:\Users\flity\AppData\Roaming\Anki2\addons21\2042118948\main.py", line 36, in export_papercards
papercard.export_paper(deck, cards)
File "C:\Users\flity\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 291, in export_paper
htmlfile, pdffile = self.generate_paper(deckname, cards)
File "C:\Users\flity\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 276, in generate_paper
pdffile = self.generate_pdf(htmlfile)
File "C:\Users\flity\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 260, in generate_pdf
cmd = [self.get_wkhtmltopdf_cmd()]
File "C:\Users\flity\AppData\Roaming\Anki2\addons21\2042118948\Papercard.py", line 219, in get_wkhtmltopdf_cmd
which = subprocess.run(['where', 'wkhtmltopdf'], encoding='utf8', capture_output=True)
File "subprocess.py", line 403, in run
<class 'TypeError'>: __init__() got an unexpected keyword argument 'capture_output'
on 1562095257
Works fine with HTML
on 1560707551
Some questions didnt even have their answers. Didnt work.
on 1556985947
cant find wkhtmltoppdf
on 1549123596
It works and looks good but generating of pdf takes a too long time.
on 1540055890
I keep getting a message saying " not enough argument for format string".
on 1537888205
Exactly what I wanted, a simple overview of a chosen card deck
on 1537009952
Useful, but work only with HTML