Free Support Forum -

Word to Scanned PDF Converter | Scan Word Document to PDF Offline (C# .NET)

By converting Word document to scanned PDF I mean production of such a PDF file from which readers, viewers or users will not be able to select or copy content (Text, Images, Tables, Equations, Form Fields etc.). To meet this scan Word to PDF requirement programmatically, we will simply first convert all pages of Word document to JPEG image streams in memory, then stich JPEG streams all together and convert this set of JPEG images to form a scanned PDF. Essentially, each page of scanned PDF will comprise of one Image reflecting the content of each Page of source Word document.

Scan Word DOCX to PDF | C# Code of Aspose.Words for .NET API

You can build logic on the following C# code of Aspose.Words for .NET SDK to automate batch scanning of Word files to PDF in your multi-threaded desktop or web applications.

string word_File_Path = "C:\\Temp\\word.docx";
string scanned_Pdf_File_Path = "C:\\Temp\\scanned.pdf";
Word_To_PDF_Scanner(word_File_Path, scanned_Pdf_File_Path);

public static void Word_To_PDF_Scanner(string word_file, string scanned_PDF_File)
    // Load Word document from file on disk
    Document doc = new Document(word_file);
    #region Word document to JPEG image memory streams
    ImageSaveOptions jpeg_Opts = new ImageSaveOptions(SaveFormat.Jpeg);
    PageRange pageRange = new PageRange(0, doc.PageCount - 1);
    jpeg_Opts.PageSet = new PageSet(pageRange);
    Word_To_Jpeg_Images jpeg_Handler = new Word_To_Jpeg_Images();
    jpeg_Opts.PageSavingCallback = jpeg_Handler;
    MemoryStream memoryStream = new MemoryStream();
    doc.Save(memoryStream, jpeg_Opts);
    #region JPEG files to Scanned PDF conversion
    Document scanned_Pdf = new Document();
    foreach (MemoryStream jpeg_Stream in jpeg_Handler.jpeg_Streams)
        using (Image jpg_image = Image.FromStream(jpeg_Stream))
            Document image_Doc = new Document();
            DocumentBuilder pdf_builder = new DocumentBuilder(image_Doc);
            PageSetup ps = pdf_builder.PageSetup;
            ps.PageWidth = ConvertUtil.PixelToPoint(jpg_image.Width, jpg_image.HorizontalResolution);
            ps.PageHeight = ConvertUtil.PixelToPoint(jpg_image.Height, jpg_image.VerticalResolution);
            // Insert the JPEG image into the document and position it at the top left corner of the page.
            scanned_Pdf.AppendDocument(image_Doc, ImportFormatMode.KeepSourceFormatting);

private class Word_To_Jpeg_Images : IPageSavingCallback
    public ArrayList jpeg_Streams = new ArrayList();
    public void PageSaving(PageSavingArgs args)
        args.PageStream = new MemoryStream();
        args.KeepPageStreamOpen = true;

Word to Scanned PDF Console Application - Demo

The following video is just the demonstration of how to convert a Word RTF document to scanned PDF by using above C# code of Aspose.Words for .NET API.