I made a function that printed a div for me, but it needs to be printed on the toner size.
This is the code:
$('#imprimirComprov').click(function () {
var conteudo = document.getElementById('imprimir').innerHTML,
tela_impressao = window.open('about:blank');
tela_impressao.document.write(conteudo);
tela_impressao.window.print();
tela_impressao.window.close();
});
The size I need is a7 (74mm × 105mm)
The image below shows how it is being shown:
Theheightdoesnotneedtobetakenintoaccount,justthewidth.
Thisistherightsizeforme.