Decrease page size for printing

Asked

Viewed 882 times

0

I made a function that printed a div for me, but I need it printed in tonner 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:

inserir a descrição da imagem aqui

Height need not be taken into account, only width.

This is the perfect size for me.

inserir a descrição da imagem aqui

1 answer

-2

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

I hope I’ve helped!

  • Anyway colleague is appearing the page in the size A4, I tried to do something to change this but it didn’t work. You can Note that the size of the images is different and even the white spaces are smaller.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.