Print multiple documents in one page.
Card is an application built on frappe framework.
- frappe (13.X.X) (tested on 13.17.0).
bench get-app https://github.com/amadhaji/card.git
bench --site <site_name> install-app card
To access the card list, go to:
Home > Tools > Printing > Card
When Create new Card.
- Enter a Name for the Card (set only once).
- Select the doctype which documents will be of its type (set only once).
- Check Fixed Width if each card has a fixed width, uncheck it if prefer to enter number of cards per page width.
- Enter Card Width in millimetre if Fixed Width checked, or Select number of Cards Per Page Width if it's unchecked.
- Check Fixed Height if each card has a fixed height, uncheck it if prefer to be Content Height.
- Enter Card Height in millimetre if Fixed Height checked.
- Enter Layout of each card, It's Jinja template and can use
{{ doc }}
which represent the card document itself, and{{ doc_card }}
which represent each selected document.
- e.x:
{{ doc.card_name }}
,{{ doc.layout }}
,{{ doc_card.<any_field_of_selected_doctype> }}
.
-
Select Border type for card, It's aimed to be out of card and used as marker for cutting.
-
Select Border Width.
-
Enter Padding in millimetre between card border and Content.
After Saving the document Print Cards button will be shown, clicking it will show MultiSelectDialog, found in it
-
default filters, they are In List View / In Standard Filter doctype fields.
-
Addition Filters.
-
table for selecting documents (20 at most).
-
Select All Check Box to select all documents meet your filters.
-
print button.
Click Print in the dialog to go to Print View, and be sure to select Card As the Print Format.
- System Manager Has All access.
- Print User able to read and print (Print Cards).
Printing DocType Description.
Document JSON.
{"card_name":"Description","doctype_card":"DocType","fixed_width":0,"card_width":0,"cards_per_page_width":"2","fixed_height":1,"card_height":30,"layout":"<div class=\"card text-white bg-secondary\">\n<div class=\"card-header\">{{ doc_card.name }}</div>\n <div class=\"card-body\">\n <p class=\"card-text\">{{ doc_card.description if doc_card.description else \"\"}}</p>\n <p class=\"card-text\">{{ doc_card.document if doc_card.documentation else \"\"}}</p>\n </div>\n</div>\n\n<style>\n .card-header{\n color: #fff;\n background-color: #888;\n font-size: 14pt;\n }\n .card{\n border: solid #888;\n min-height:100%;\n }\n .card-text{\n padding: 1mm;\n font-size: 10pt;\n }\n</style>","border":"dashed","padding":2,"border_width":"thin","doctype":"Card"}
hint: Copy the JSON text and paste it anywhere in browser while browsing frappe. to create new doc from the JSON.
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/