SoFunction
Updated on 2025-04-09

4 ways to print Word documents in C#

Word documents are an indispensable part of daily office and study. For example, in business transactions, it is often necessary to print Word documents to write and deliver formal business letters, cooperation agreements, project proposals, etc. The printed documents are convenient for both parties to sign and seal, and are legally effective and formal. This article will provide the following 4 methods of printing Word documents through C# to meet different scenario needs.

Free .NET Word Library -Free  for .NET. To implement printing Word documents through C#, we need to install this free library (with page limit). You can search for "" directly in Visual Studio through NuGet, and then click "Install" to reference it to the program. Or download the product package through this link, unzip it and manually add the dll file to the program.

C# Print Word Documents with Physical Printer

Through the PrintDocument class provided by the free .NET library, we can print Word documents on the specified printer, and we can also specify settings printing options, such as the page range, number of copies, and paper size to print.

C# code:

using ;
using ;
 
namespace PrintWordDocument
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load Word document            Document doc = new Document();
            ("Example.docx");
 
            // Get PrintDocument object            PrintDocument printDoc = ;
 
            // Specify the printer name             = "Printer Name";
 
            // Specify the page range to print             = 1;
             = 10;
 
            // Set the number of copies to print             = 1;
 
            // Specify the paper size             = new PaperSize("custom", 500, 800);
 
            // Print the document            ();
        }
    }
}

C# silently print Word documents

Silent printing means that the printing operation is automatically completed through the program or system settings during the printing process without popping up the printing dialog box. With Free , we can set the PrintController property to StandardPrintController to hide the print process, thus achieving silent printing.

C# code:

using ;
using ;
 
namespace SilentlyPrintWord
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load Word document            Document doc = new Document();
            ("Example.docx");
 
            // Get PrintDocument object            PrintDocument printDoc = ;
 
            // Specify the printer name             = "Printer Name";
 
            // Set PrintController property to StandardPrintController to hide the printing process             = new StandardPrintController();
 
            // Print the document            ();
        }
    }
}

Note: The printing effect and parameter settings cannot be confirmed in real time when printing silently. If the printer fails or the printing parameter settings are incorrect, it may cause the printing to fail or the results to not meet expectations. Therefore, before officially using silent printing, it is recommended to conduct tests to ensure that the printing settings and printer status are normal.

C# Convert Word to PDF via Virtual Printer

A virtual printer is a kind of software that can simulate and implement the functions of the printer, but does not involve actual paper and ink consumption, but converts electronic documents into electronic files in a specific format to save them on a computer. In addition to physical printers, Free also supports the use of virtual printers.

C# code:

using ;
using ;
 
namespace PrintWordToPdf
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load Word document            Document doc = new Document();
            ("Example.docx");
 
            // Get PrintDocument object            PrintDocument printDoc = ;
 
            // Print output to file             = true;
 
            // Specify the virtual printer name             = "Microsoft Print to PDF";
 
            // Specify the output file path and name             = @"C:\Users\Administrator\Desktop\";
 
            // Print the document            ();
        }
    }
}

C# Print multiple pages on one piece of paper

Print multiple relevant Word document pages on one piece of paper to facilitate comparison viewing and organizing information, improve work efficiency, and reduce paper waste. This operation can be achieved by using the PrintMultipageToOneSheet() method.

C# code:

using ;
using ;
using ;
 
namespace PrintMultiplePagesOnOneSheet
{
    internal class Program
    {
        static void Main(string[] args)
        {
            // Load Word document            Document doc = new Document();
            ("Example.docx");
 
            // Get PrintDocument object            PrintDocument printDoc = ;
 
            // Enable single-sided printing             = ;
 
            // Print the specified number of pages to one page            (, false);
        }
    }
}

This is the end of this article about 4 ways to print Word documents in C#. For more related C#, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!