Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda