Remove PDF padding / margin

i have finally solved it . The css does take styles while exporting to pdf but erpnext seems to be caching and making html and css files of its own , due to which you cannot see changes instantly . so after every css change you make . just run the following commands and then see the output.

Edit this file /home/user/erpnext/apps/frappe/frappe/utils/pdf.py
edit lines 66,67,139,142
put values 0mm.

the run the following code one by one

bench clear-cache
bench clear-website-cache
bench build
bench restart
bench start

You will get a pdf with no margins and padding

attaching a screenshot

Whoever needs code for my template you see in screenshot , send me a message and i will send it to you , cant seem to add it here .

6 Likes