Decrease page size for printing

0

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.

    
asked by anonymous 03.06.2017 / 22:19

1 answer

-1

You can use: @media print, so you can specify the size, here's an example: JSFIDDLE EXAMPLE

I hope I have helped!

    
04.06.2017 / 03:14