Click here to Skip to main content
15,882,552 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi We have website and hosted in different domain ,not in same network.That website have some files doc,pdf and png,when access that website using url and try to print,then need to call client side print and print that file,In chrome and mozila client side print code woring only for pdf file,may be pdf viewer installed in client machine,ie,edge it just ask save,save as and open option,but we need to call client side printer without saving in client is possible ?

What I have tried:

This only work in chrome and mozilla
function btnPrint1_ClientClick() {
              var opts = 'width=700,height=500,toolbar=0,menubar=0,location=1,status=1,scrollbars=1,resizable=1,left=0,top=0';
              var newWindow ="pdf/SKMBT_C22416051313120.pdf", 'name', opts);
              return false;


This server side code nothing happen
Dim objPJ As New Process
        objPJ.StartInfo.FileName = Server.MapPath("") + "/pdf/originalfile.pdf"
        objPJ.StartInfo.Verb = "Print"
        objPJ.StartInfo.CreateNoWindow = True
        objPJ.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
        Dim setting As New PrinterSettings
        setting.DefaultPageSettings.Landscape = True

I referred this link


1 solution

All you can do is send the file to the client and if they have a way of printing that file (ie they have a PDF reader of some sort if it is a PDF, or Word if it is a Word file) then they can choose to print the document if they want to. You can't influence client-side printing from your server code. If they don't have a PDF reader they'll just need to install one.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900