Letter Head Choose Option

I have a few letter head so I want to add letter head choose option in print.
How can I add this option in print

2 Likes

What have you tried so far?

I tried to make with custom field but I can’t find anything and I read your message at another discussion that you suggested that to add in custom field.

Hi @alimert801,

in case you are using a custom print format, add a custom field named letter_head with a link to the letter head. Then, in your custom print format, add a code snippet like this:

<div id="header-html" class="hidden-pdf">
  {% set letter_head = frappe.get_doc("Letter Head", doc.letter_head) %}
  {% if letter_head %}
	{{ letter_head.content }}
  {% else %}
	<p>Letter head {{ doc.letter_head }} not found. Please define the letter head under print settings.</p>
  {% endif %}
</div> 

Hope this helps…

1 Like

Sorry but I cant understand. Where do I add this code?

The function is there in each DocType. Before getting print view choose the letter head which will go into print. We use two, depending on user choice we use one.

hello, I want to achieve the same thing.
I haven’t quite understood what needs to be done to get such option.
Any pointers?
Thanks

Hello,
You can set the letterhead at document level in print settings section.