Giter Site home page Giter Site logo

card's Introduction

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/

card's People

Contributors

amadhaji avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.