Print without displaying print dialogue box using window.print in JavaScript

lingers
 
on Mar 15, 2021 12:09 AM
2807 Views

How to Print automatically without displaying print dialogue box.

I have this biometric canteen system i deployed for an organization, but the issue i am having is that in the print dialogue box, the staffs are printing numerous number of same ticket.

What they do is that they enter various number of ticket to print in the print dialogue box. I want to print 1 ticket from the default printer without showing dialogue box, so that nobody can print numerous same ticket from the print dialogue box.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class BioPluginWebApp_Reciept1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        ScriptManager.RegisterClientScriptBlock(this.Page, typeof(string), "print", "window.print();", true);
    }
}

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download