Footer don't show in pdf

Hi, friend. I put this code in my sales invoice print format to make it show the footer but this only showed in preview, when I generated the pdf the footer didn’t show up.

    <div id="footer-html" class="visible-pdf">
        {% if not no_letterhead and footer %}
        <div class="letter-head-footer">
            {{ footer }}
        </div>
        {% endif %}
        <p class="text-center small page-number visible-pdf">
            {{ _("Page {0} of {1}").format('<span class="page"></span>', '<span class="topage"></span>') }}
        </p>
    </div>```
I'm using wkhtmltopdf 0.12.6.
Thanks a lot.

@Ignais_La_Paz_Trujil try to add class=“page-footer” to the parent instead of visible-pdf . and remove the letter-head-footer class

hi

how you added the if loop

	{% if print_settings.repeat_header_footer %}
	<div id="footer-html" class="visible-pdf">
		{% if not no_letterhead and footer %}
		<div class="letter-head-footer">
            {{ footer }}
		</div>
		{% endif %}
        <div class="pagenumber visible-pdf">
    		{{ _("Page {0} of {1}").format('<span class="page"></span>', '<span class="topage"></span>') }}
    	</div>
	</div>
	{% endif %}

and check your print settings

I got it. And I tried but it didn’t work.

Thanks. I tried but it didn’t work.

@Ignais_La_Paz_Trujil have you set any margins of any type in css ?

css to footer

.footer-image {
    height: 50px;
}
.footer-data {
    display: flex;
}
#footer {
    position: fixed;
    bottom: 0;
    width: 100%;
}```

@Ignais_La_Paz_Trujil remove every thing about footer . pdf has it’s own way to put footer . try mine . it’s working fine

 {% if not no_letterhead %}
  <div class="page-footer" id ="footer-html">
     
    <div id="htmlfooter" style="width:100%;">
     <p class="text-center page-number visible-pdf" style="font-size:13px;">
            {{ _("<b> {0}/{1} </b>").format('<span class="page"></span>', '<span class="topage"></span>') }}
        </p>
   
</div>

  </div>
       {% endif %}

The problem persists, it looks fine in the preview and is lost in the pdf. Thanks for trying to help me, but if you think of any other solution it will be appreciated.

could you check your browser console to see if you have any error ?

I checked my html code and the script that generated de footer is this

<script>
		document.addEventListener('DOMContentLoaded', () => {
			const page_div = document.querySelector('.page-break');

			page_div.style.display = 'flex';
			page_div.style.flexDirection = 'column';

			const footer_html = document.getElementById('footer-html');
			footer_html.classList.add('hidden-pdf');
			footer_html.classList.remove('visible-pdf');
			footer_html.style.order = 1;
			footer_html.style.marginTop = '20px';
		});
	</script>

Could you remove this script and check if it works ?

below is the frappe print format pdf-header footer html template… Not sure why you are using the script for ?

The PDF includes other scanned documents , so we can’t use the Word footer for this. If we replace page in the PDF, which isn’t uncommon, we have to update the PDF footer. For most users, this wipes out the Word header and footer in the PDF. If this reply is not helpful for kindly tell me here. I am going to bookmark this thread https://discuss.erpnext.com/t/footer-dont-show-in-pdf/86995-gosloto to get more updates from here.

Thanks

As additional information I am using macros and I have tested the tags with both static html code and jinja code and it is always the same result, it is shown correctly in the preview and when generating the pdf (from Mozilla and Chrome) it disappears.