Convert to multipage-TIFF using C# and .NET

In today's digital world, document processing is an important part of solutions for businesses and individual users. One of the common image formats for storing document pages is TIFF (Tagged Image File Format), especially when it comes to multi-page images. In this article, we will explain in detail how to use the SautinSoft Pdf .Net library for converting PDF files to multipage TIFF images using C# and .NET.

Multipage-TIFF is a format that is great for storing multiple images (pages) inside a single file. This format is widely used in electronic document management systems, archival systems and for protection against changes, as TIFF supports various compression modes and provides high-quality images.

Advantages of multipage TIFF:

  • Versatility. It is suitable for storing all documentation in one file.
  • Compression and quality. Thanks to the development of compression methods, TIFF allows you to save high-quality images with minimal volume.
  • Compatibility. It is supported by many image viewer systems and editors.

Reasons for use:

  • Archiving. Long-term storage of documents in single files for easy accounting and search.
  • Exchange of documents. Sending documents as images when the requirements are such that the original files are unavailable.
  • Image processing and analysis. Data preparation for text recognition (OCR) or image processing systems.
  • Legal and judicial needs. Preservation of evidence in an unchangeable form.

Using SautinSoft Pdf .Net is used by professional developers, system integrators, and organizations around the world for these tasks because it provides reliability and ease of implementation.

Input file:

find and replace by different input

Output result:

find and replace by different output pdf

Complete code

using System;
using System.IO;
using System.Reflection;
using SautinSoft;
using SautinSoft.Pdf;
using SautinSoft.Pdf.Content;

namespace Sample
{
    class Sample
    {
        /// <summary>
        /// Convert PDF to TIFF in C# and .NET.
        /// </summary>
        /// <remarks>
        /// Details: https://sautinsoft.com/products/pdf/help/net/developer-guide/convert-pdf-to-multipage-tiff-using-csharp-and-dotnet.php
        /// </remarks>
        static void Main(string[] args)
        {
            // Before starting this example, please get a free trial key:
            // https://sautinsoft.com/start-for-free/

            // Apply the key here:
            // PdfDocument.SetLicense("...");

            // Load a PDF document.
            using (var document = PdfDocument.Load(Path.GetFullPath(@"..\..\..\Butterfly.pdf")))
            {
                // Create image save options.
                var tiffOptions = new ImageSaveOptions() 
                { 
                    Format = ImageSaveFormat.Tiff, 
                    // Start from the second page (index 1).
                    PageIndex = 1,
                    PageCount = 3,
                    DpiX = 300,
                    DpiY = 300,
                    PixelFormat = PixelFormat.Rgb24 
                };

                // Save a TIFF file.
                document.Save("Result.tiff", tiffOptions);
            }

            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(@"Result.tiff") { UseShellExecute = true });
        }
    }
}

Download

Option Infer On

Imports System
Imports System.IO
Imports System.Reflection.Metadata
Imports SautinSoft
Imports SautinSoft.Pdf
Imports SautinSoft.Pdf.Content

Namespace Sample
	Friend Class Sample
		''' <summary>
		''' Convert PDF to TIFF in C# and .NET.
		''' </summary>
		''' <remarks>
		''' Details: https://sautinsoft.com/products/pdf/help/net/developer-guide/convert-pdf-to-multipage-tiff-using-csharp-and-dotnet.php
		''' </remarks>
		Shared Sub Main(ByVal args() As String)
			' Before starting this example, please get a free trial key:
			' https://sautinsoft.com/start-for-free/

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

			' Load a PDF document.
			Using document = PdfDocument.Load(Path.GetFullPath("..\..\..\Butterfly.pdf"))
				' Create image save options.
				Dim tiffOptions = New ImageSaveOptions() With {
					.Format = ImageSaveFormat.Tiff,
					.PageIndex = 1,
					.PageCount = 3,
					.DpiX = 300,
					.DpiY = 300,
					.PixelFormat = PixelFormat.Rgb24
				}

				' Save a TIFF file.
				document.Save("Result.tiff", tiffOptions)
			End Using

			System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo("Result.tiff") With {.UseShellExecute = True})
		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.