Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!