From 343af6af46963dff72b4d373891f640d3f19eda5 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 31 Jul 2017 10:59:24 +0530 Subject: [PATCH] Hide links in pdf (#3814) * Hide links in pdf * Show footer in print preview --- frappe/public/js/frappe/form/print.js | 11 +++++++++++ frappe/templates/print_formats/pdf_header_footer.html | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/frappe/public/js/frappe/form/print.js b/frappe/public/js/frappe/form/print.js index 18a5891f36..0e7e75299a 100644 --- a/frappe/public/js/frappe/form/print.js +++ b/frappe/public/js/frappe/form/print.js @@ -125,9 +125,20 @@ frappe.ui.form.PrintPreview = Class.extend({ var me = this; this.get_print_html(function (out) { me.wrapper.find(".print-format").html(out.html); + me.show_footer(); me.set_style(out.style); }); }, + show_footer: function() { + // footer is hidden by default as reqd by pdf generation + // simple hack to show it in print preview + this.wrapper.find('.print-format').css('position', 'relative'); + this.wrapper.find('#footer-html').attr('style', ` + display: block !important; + position: absolute; + bottom: 0.75in; + `); + }, printit: function () { this.new_page_preview(true); }, diff --git a/frappe/templates/print_formats/pdf_header_footer.html b/frappe/templates/print_formats/pdf_header_footer.html index ed50c3db3b..ca72a990e3 100644 --- a/frappe/templates/print_formats/pdf_header_footer.html +++ b/frappe/templates/print_formats/pdf_header_footer.html @@ -34,6 +34,13 @@ .letter-head-footer { margin-top: -15mm !important; } + + /* Dont show explicit links for tags */ + @media print { + a[href]:after { + content: none; + } + }