ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Custom Print Format shows error while generating PDF

print_format

#1

I have written a custom print format for a docType, print is perfect as I wanted. Now when I click on PDF to generate pdf file it takes me to new page where page keeps on loading and at the end 504 gateway error appears, how ever when I change the print format to default, PDF is generate with in no time.

I assume there must a code of line to end print format which conclude/finishes PDF print command properly.

Thanks.


#2

Edit sites/{site_name}/site_config.json. Add
“host_name”: “localhost”


#3

Already tried, but nothing happens.

Please note that default format are generating PDF perfectly. Problem is with customr print format.


#4

There was a image in my custom print format, temporarily I have removed the image and it worked but unfortunately the PDF file is always empty.


#5

Additionially, 504 error was coming due to the image used for print format.

Images used for PDF format must be supplide with complete url including domain or VPS ip (along with port - incase of multi tenancy), relative url doesn’t work for PDF.