Skip to content

amadhaji/card

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Card

Print multiple documents in one page.

Card is an application built on frappe framework.

Installation.

1. Dependencies

  1. frappe (13.X.X) (tested on 13.17.0).

2. Installation.

bench get-app https://github.com/amadhaji/card.git
bench --site <site_name> install-app card

Use

To access the card list, go to:

Home > Tools > Printing > Card

1. Create Card.

When Create new Card.

  1. Enter a Name for the Card (set only once).
  2. Select the doctype which documents will be of its type (set only once).
  3. Check Fixed Width if each card has a fixed width, uncheck it if prefer to enter number of cards per page width.
  4. Enter Card Width in millimetre if Fixed Width checked, or Select number of Cards Per Page Width if it's unchecked.
  5. Check Fixed Height if each card has a fixed height, uncheck it if prefer to be Content Height.
  6. Enter Card Height in millimetre if Fixed Height checked.
  7. 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> }}.
  1. Select Border type for card, It's aimed to be out of card and used as marker for cutting.

  2. Select Border Width.

  3. Enter Padding in millimetre between card border and Content.

2. Print Cards.

After Saving the document Print Cards button will be shown, clicking it will show MultiSelectDialog, found in it

  1. default filters, they are In List View / In Standard Filter doctype fields.

  2. Addition Filters.

  3. table for selecting documents (20 at most).

  4. Select All Check Box to select all documents meet your filters.

  5. print button.

Click Print in the dialog to go to Print View, and be sure to select Card As the Print Format.

3. Permissions.

  • System Manager Has All access.
  • Print User able to read and print (Print Cards).

4. Example:

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.



description_doctype.png


print_description_docType

License

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published