frappe / print_designer

Visual print designer for Frappe / ERPNext
GNU Affero General Public License v3.0
204 stars 112 forks source link

allow user provided jinja template renderer #317

Open BaaridunNasr opened 2 months ago

BaaridunNasr commented 2 months ago

Is there perhaps a way to maintain fixed row height for a table?

I am attempting to print 1 row per page (this is basically labels for items). In this case, if I match the row height and table container height, there will be 1 row per page.

maharshivpatel commented 1 month ago

@PhantomKunai what you are asking for is page break at row level ?

BaaridunNasr commented 1 month ago

@maharshivpatel You could say that. Ideally the goal is to be able to print labels for a list of items in a child table, and each item appears on one page. Right now I am unable to

  1. break after a row (or)
  2. set the row height such that it spans the page height and automatically page breaks as it works now
maharshivpatel commented 1 month ago

@PhantomKunai if you don't mind me asking why not design 1 label and print using list view ?

BaaridunNasr commented 1 month ago

@maharshivpatel Here I designed a label. And in here I am trying to print a child table as this will contain specific information pertaining to that item received ( example, inspection seal, date received and so on )

image

It seems counter productive to create a separate doc for each label and print from the list view.

We achieved this previously by using jinja to parse through tables and setting minimum and maximum dimensions for elements to fit each in one page.

BaaridunNasr commented 1 month ago

Ideally, each number should be on one page. Generating 6 pages.

maharshivpatel commented 1 month ago

maybe, option to access per row data and interface for printing each row per document can work ?

BaaridunNasr commented 1 month ago

Yes that would seem like a solution for this. However, I think really it must be possible to build some html components using jinja. As I understand it now, Jinja is mainly used only to pre-process data in Print Designer.

Perhaps some blocks which act as containers and placeholders to simply render some html using jinja within its position on the page.

maharshivpatel commented 1 month ago

yeah, already on my mind 😅. but will take some time.