I am looking for a solution on how to make the PDF printout look exactly the same as on the preview. Seems that it is not working sind 2014 guess we have discussed this topic already earlier.
Since I am now actively working on my ERPNext v6 copy I am still wondering why the PDF does not look as expected
Any clues whatās wrong?
Btw the Problem:
Tables created in the Format-Builder are not going to be printed correctly, they are stated all below each other.
Only the āTitleā and the products-table is shown (nearly) as expected.
Any others got that problem?
Edit:
Seems that this āissueā is working in Odooā¦maybe we should take a look at ātheirā PDF engine?
since I stumbled upon a few hints on external sources regarding wk html to pdf I am about to build a complete custom form using my HTML and CSS Knowledge. That works so far very well with āstaticā data.
Since you know Iāve moved from V4 I still have the following code made for my last printoutā¦but it seems to be not valid any more.
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
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
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 for that information.
You guess right: another question arises nowā¦sorry for that
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?
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.
I have to admit that the hooks are not my first choiceā¦a multi-bench-setup would be f* great 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?