Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

199
Visualizações
How to prepopulate name of the printer in the browser

I'm using ASP.NET MVC and I'm using a function with AJAX that opens in the browser the window to print.

My questions is when I print I would like to already set the printer name without select the printer that I need there is any way to do that? I'm going to leave my code of my function below and a image.

function print() {
    //Serialize the form datas.   
    var printdata = $("#PrintLabel").serialize();
    
    $.ajax({
        type: "POST",
        dataType: 'HTML',
        contentType: 'application/x-www-form-urlencoded',
        url: PrintPreviewUrl,
        data: printdata,
        cache: false,
        success: function (response) {
            window.$("#printModalCenter").modal('hide');
            var WinPrint = window.open('', '', 'left=100,top=100,width=600,height=600');

            WinPrint.document.write(response);

            setTimeout(function () {
                WinPrint.print();
                WinPrint.close();

            },
                500);

        },
        fail: function () {
            WinPrint.document.close();
            WinPrint.focus();
        }
    });

This is the part that I want to prepopulate the name of the printer without having to choose and scroll down, I automatically want the name to appear when the window opens.

enter image description here

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda