Ver código fonte

Hide links in pdf (#3814)

* Hide links in pdf

* Show footer in print preview
version-14
Faris Ansari 8 anos atrás
committed by Rushabh Mehta
pai
commit
343af6af46
2 arquivos alterados com 18 adições e 0 exclusões
  1. +11
    -0
      frappe/public/js/frappe/form/print.js
  2. +7
    -0
      frappe/templates/print_formats/pdf_header_footer.html

+ 11
- 0
frappe/public/js/frappe/form/print.js Ver arquivo

@@ -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);
},


+ 7
- 0
frappe/templates/print_formats/pdf_header_footer.html Ver arquivo

@@ -34,6 +34,13 @@
.letter-head-footer {
margin-top: -15mm !important;
}

/* Dont show explicit links for <a> tags */
@media print {
a[href]:after {
content: none;
}
}
</style>

<!-- from: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt -->


Carregando…
Cancelar
Salvar