Convert PDF file to Black&White Multipage-TIFF in C# and .NET


In today's document processing world, there's often a need to convert PDF files to formats where size optimization, visual consistency, and compatibility are crucial. One popular solution for this task is converting PDFs to multi-page TIFF files with a black-and-white color palette. This is especially important in a world where archiving, emailing, or integrating documents into a document management system are crucial.

In this article, we'll take a detailed look at how to automatically convert PDF files to black-and-white multi-page TIFFs in a .NET application using the powerful PDF Focus .NET from SautinSoft SDK. You'll receive not only technical guidance but also an understanding of use cases where this feature might be useful, as well as unique implementation considerations.

Converting PDFs to TIFFs (especially multi-page TIFFs) is relevant for a number of reasons:

  • Archiving and storage: TIFF is a widely used format for storing high-quality images.
  • Optimized for viewing: Black-and-white TIFF files are significantly smaller in size, which impacts their delivery and processing speed.
  • Quality compatibility: Many people and devices prefer the TIFF format for viewing or printing documents.
  • Enhanced security: Converting to an image helps protect standards from unauthorized editing.

Practical applications and use cases:

  • Electronic document archives: Automatic conversion of paper and digital PDF documents for long-term storage.
  • Production control in logistics: Converting specifications or delivery notes for compatibility with variable connection and printing.
  • Educational institutions: Creating black-and-white copies of scientific materials for printing large-scale documents.
  • Medical institutions: Standardizing image and report storage and transmission formats.

Use frequency and prospects.
Converting PDF to TIFF is a common operation, especially in cases where standardization and information security are important. With the flourishing of document flow, as well as in archives and banking documents, such solutions are used constantly.

Input file:

convert pdf to black white multipage tiff input

Output result:

convert pdf to black white multipage tiff output

Complete code

using System;
using System.IO;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            // Before starting, we recommend to get a free key:
            // https://sautinsoft.com/start-for-free/
            
            // Apply the key here:
            // SautinSoft.PdfFocus.SetLicense("...");
			
            // Convert PDF file to BlackAndWhite Multipage-TIFF.
            SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();

            string pdfPath = Path.GetFullPath(@"..\..\..\simple text.pdf");
            string tiffPath = "Result.tiff";

            f.OpenPdf(pdfPath);

            if (f.PageCount > 0)
            {
                f.ImageOptions.ImageFormat = SautinSoft.PdfFocus.CImageOptions.ImageFormats.Tif;
                f.ImageOptions.Dpi = 300;
                f.ImageOptions.ColorDepth = SautinSoft.PdfFocus.CImageOptions.eColorDepth.BlackWhite1bpp;
                
                if (f.ToImage(tiffPath) == 0)
                {
                    System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(tiffPath) { UseShellExecute = true });
                }
            }            
        }
    }
}

Download

Imports System
Imports System.IO

Namespace Sample
	Friend Class Sample
		Shared Sub Main(ByVal args() As String)
			' Before starting, we recommend to get a free key:
			' https://sautinsoft.com/start-for-free/

			' Apply the key here:
			' SautinSoft.PdfFocus.SetLicense("...");

			' Convert PDF file to BlackAndWhite Multipage-TIFF.
			Dim f As New SautinSoft.PdfFocus()

			Dim pdfPath As String = Path.GetFullPath("..\..\..\simple text.pdf")
			Dim tiffPath As String = "Result.tiff"

			f.OpenPdf(pdfPath)

			If f.PageCount > 0 Then
				f.ImageOptions.ImageFormat = SautinSoft.PdfFocus.CImageOptions.ImageFormats.Tif
				f.ImageOptions.Dpi = 300
				f.ImageOptions.ColorDepth = SautinSoft.PdfFocus.CImageOptions.eColorDepth.BlackWhite1bpp

				If f.ToImage(tiffPath) = 0 Then
					System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(tiffPath) With {.UseShellExecute = True})
				End If
			End If
		End Sub
	End Class
End Namespace

Download


If you need a new code example or have a question: email us at support@sautinsoft.com or ask at Online Chat (right-bottom corner of this page) or use the Form below:


Captcha

Questions and suggestions from you are always welcome!

We are developing .Net components since 2002. We know PDF, DOCX, RTF, HTML, XLSX and Images formats. If you need any assistance with creating, modifying or converting documents in various formats, we can help you. We will write any code example for you absolutely free.