Print Any document file like doc,docx ,jpg ,pdf using C# code without open the these document file doc,docx,jpg,pdf

(1)Put one text box control and two button on button for browse and another one for Print.

(2)Place this code in .cs file of this window form.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;//this name space included for this task

namespace PrintWordFileInCsharp
    public partial class Form1 : Form
        public Form1()

        private void btnBrowse_Click(object sender, EventArgs e)
            DialogResult dr = openFileDialog1.ShowDialog();
            textBox1.Text = openFileDialog1.FileName;

        private void btnPrint_Click(object sender, EventArgs e)
//Below code print your word and any other document without open.
            ProcessStartInfo info = new ProcessStartInfo(textBox1.Text); //in this pass the file path
            info.Verb = "Print";
            info.CreateNoWindow = true;
            info.WindowStyle = ProcessWindowStyle.Hidden;


Priti Kumari

I am technical blogger.I blogs at and


  1. Hi Priti,
    Thanks for the article, Very informative. Aspose.Pdf for .NET C#is also another good option can be considered for Printing from a Windows Service. Here the code sample: The following code snippet shows how to print a PDF file

    //Create PdfViewer object
    PdfViewer viewer = new PdfViewer();
    //Open input PDF file
    //Print PDF document
    //Close PDF file