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:
Reasons for use:
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.
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 });
}
}
}
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
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: