PDF output looks bad

@anand
Thanks for your message.
I cannot reproduce @ demo because I can’t create a new print-template.

Regarding screenshot:

The first one is - as you assume - the “original printout”.
The second one is my company’s CI lookalike…ps: the table with products is just dummy-data as it is not working :confused:

edit:
can we delete the “Draft” as well?

best,
Dan

no one?

In the Print Format record, you need to set:

  1. Standard = No
  2. Custom Format = checked
  3. Print Format Type = Standard
  4. Write your code in HTML

Now you can write any Jinja that you want. See the help at the bottom of the Print Format doc.

This is still not working :confused:

@anand,

Sorry for bothering you again. But I tried not a lot…it does not recognize “doc.” do I have to call a macro before?

Best,
Dan

@daniel

There is no variable called ‘data’, use doc only

@anand

Wow, that was a really fast information. Yep, the output is not “ok”. One more question, how is the page-break defined in standard output? I can’t seen to find it in standard.html…

Edit:
I’d like to help you and share my code with others…but where is the printout of the PDF itself defined?
I want to add a header to the printout and I want to check if advanced WKHTMLTOPDF options are possible. This may help further development of ERPNext? Thanks already in advance @anand

best,
Dan

Give a div class=“page-break”

thank you @anand

But basically what I mean in detail is:
Where is the function itself that generates the PDF. Because since WKHTMLTOPDF offers a variety of options like header and footer for printout, I’d like to test it. But I can’t seem to find the corresponding file to change it.

Thanks in advance!
Daniel

Search for pdf.py

Hi @anand,

thanks for that information.
You guess right: another question arises now…sorry for that :frowning:

I am now running a multi-site-setup with 3x ERPNext. Problem…when I change e.g. the --background in pdf.py options, that changes my output in all 3 sites…is there a change to differentiate?

Best,
Daniel

1 Like

Since the code is common, it will affect all sites.

You should either put the modified code in another frappe app and call it via hook, or use multiple benches. But right now multiple benches will be tricky to setup.

1 Like

I have to admit that the hooks are not my first choice…a multi-bench-setup would be f* great :wink: but right now since this is kind of tricky I won’t recommend that either.

I guess the better choice here is to choose more servers ?

What just came to my mind…how about doing it with like an if function. Is there a possibility for the pdf.py to determine which site is calling the python file?

You are in luck. We are going to release a multi-bench fix next week: [Major] Multi-bench setup by shreyasp · Pull Request #187 · frappe/bench · GitHub

@anand
Where can I just put you on top of my fav devs :wink: this

IS AWESOME.

1 Like

so this is due in a few days?
Daniel

Yes still a few issues to iron out before it is ready for production use

Cool. Is there a chance to sign up for that or will you post a short update here?

@anand

Is the fix out already?

1 Like