Sales Order attach without header

Hi to all,
When I try to print the Sales Order, or I generate the PDF the sales order is created correctly with header and logo, while if i try to send email with the sales order it arrive without header logo as you can see in the images

Email version:

Print Preview and pdf exrtaction:

1 Like

They seem like completely different Print Formats. Are you selecting the correct one while emailing?

STANDARD version is selected as you can see on the screenshot, that is the same version shown in the preview.

You need to put host name in site config

Thanks, can you exactly tell where i have to modify this configuration?

go to /frappe-bench/sites/yoursite/site_config.json

and add following

“host_name”: “http://ip”,

ip= your ip or website address

1 Like

Thanksss It Works!!! :smiley:

I`v the same problem and i checked the host_name value and its exist

what can i do ??

Try
bench set-url-root sitename http://example.com

same error :frowning:

i found that error in log

Error Report

Python 2.7.6: /home/frappe/frappe-bench/env/bin/python (prefix: /home/frappe/frappe-bench/env)

Timestamp:
2017-11-13 16:17:41.115826
Relapsed
33
Exception

args (u’wkhtmltopdf reported an error:\nExit with code 1 due to network error: ConnectionRefusedError\n’,)
errno None
filename None
message wkhtmltopdf reported an error: Exit with code 1 due to network error: ConnectionRefusedError
strerror None
Locals

args [u’/usr/local/bin/wkhtmltopdf’, u’–page-size’, ‘A4’, u’–header-html’, ‘/tmp/frappe-pdf-8d29f646cfc22d443d292c227d62b4c097e94340169166013f0532f4.html’, u’–footer-html’, ‘/tmp/frappe-pdf-ed4a177684e760776140157afcf4c1aaf544b42fc569a13526c3a9c9.html’, u’–encoding’, ‘UTF-8’, u’–margin-right’, ‘15mm’, u’–quiet’, u’–cookie’, u’sid’, u’2fea10badf4525555b35747f4da85879a89c4334e9550f559db4c0c8’, u’–background’, u’–margin-left’, ‘15mm’, u’–images’, u’–print-media-type’, …]
exit_code 1
input ‘\n\n \n \n \n \n’
path u’/tmp/frappe-pdf-2774fcdbdc7b7594e76ec15d6bdd9805bb11259945d3e7f0efef55a6.pdf’
result
self
stderr ‘Exit with code 1 due to network error: ConnectionRefusedError\n’
stdout ‘’
Traceback

/home/frappe/frappe-bench/apps/frappe/frappe/app.py: 62

60 if frappe.local.form_dict.data is None:
61 frappe.local.form_dict.data = request.get_data()
62 response = frappe.api.handle()
63
64 elif frappe.request.path.startswith(‘/backups’):
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/api.py: 53

51 if call==“method”:
52 frappe.local.form_dict.cmd = doctype
53 return frappe.handler.handle()
54
55 elif call==“resource”:
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 22

20
21 if cmd!=‘login’:
22 data = execute_cmd(cmd)
23
24 if data:
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/handler.py: 53

51 is_whitelisted(method)
52
53 return frappe.call(method, **frappe.form_dict)
54
55
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/init.py: 935

933 del newargs[“flags”]
934
935 return fn(*args, **newargs)
936
937 def make_property_setter(args, ignore_validate=False, validate_fields_for_doctype=True):
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/utils/print_format.py: 48

46 html = frappe.get_print(doctype, name, format, doc=doc)
47 frappe.local.response.filename = “{name}.pdf”.format(name=name.replace(" “, “-”).replace(”/", “-”))
48 frappe.local.response.filecontent = get_pdf(html)
49 frappe.local.response.type = “download”
50
Locals
/home/frappe/frappe-bench/apps/frappe/frappe/utils/pdf.py: 17

15
16 try:
17 pdfkit.from_string(html, fname, options=options or {})
18 if output:
19 append_pdf(PdfFileReader(file(fname,“rb”)),output)
Locals
/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/api.py: 68

66 configuration=configuration)
67
68 return r.to_pdf(output_path)
69
70
Locals
/home/frappe/frappe-bench/env/src/pdfkit/pdfkit/pdfkit.py: 140

138
139 if ‘Error’ in stderr.decode(‘utf-8’):
140 raise IOError(‘wkhtmltopdf reported an error:\n’ + stderr.decode(‘utf-8’))
141
142 if exit_code != 0: