Saves whole PDF document into multipage TIFF file

Namespace:  SautinSoft
Assembly:  SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 6.6.9.7 (6.6.9.7)

Syntax

      
 C#  Visual Basic 
public int ToMultipageTiff(
	string fileName,
	EncoderValue compressionType
)
Public Function ToMultipageTiff ( _
	fileName As String, _
	compressionType As EncoderValue _
) As Integer

Parameters

fileName
String
Path to multipage TIFF file
compressionType
EncoderValue
Allows to set compression type: CompressionCCITT3, CompressionCCITT4, CompressionLZW, CompressionRle, CompressionNone

Return Value

0 - saving successfully
2 - can't create output file, check the output path
3 - saving failed, email to support@sautinsoft.com

Remarks

To start the process, please download the most fresh version of PDF Focus .Net.

Before converting you may set various image properties using the property ImageOptions. For example, set:
  • Dpi - image resolution in dots per inch. Default value: 120
  • ColorDepth - color depth or bit depth is the number of bits used to represent the color of a single pixel. Default value: 24 bit RGB


Examples

CopyHow to convert PDF file to Black&White Multipage-TIFF in C#
using System;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;

namespace Sample
{
    class Sample
    {
        static void Main(string[] args)
        {
            // Convert PDF file to BlackAndWhite Multipage-TIFF.
            SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();

            // This property is necessary only for registered version.
            //f.Serial = "XXXXXXXXXXX";

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

            f.OpenPdf(pdfPath);

            if (f.PageCount > 0)
            {
                f.ImageOptions.Dpi = 120;
                f.ImageOptions.ColorDepth = SautinSoft.PdfFocus.CImageOptions.eColorDepth.BlackWhite1bpp;
                // EncoderValue.CompressionCCITT4 - also makes image black&white 1 bit
                if (f.ToMultipageTiff(tiffPath, EncoderValue.CompressionCCITT4) == 0)
                {
                    System.Diagnostics.Process.Start(tiffPath);
                }
            }            
        }
    }
}
CopyHow to convert PDF file to Black&White Multipage-TIFF in VB.Net
Imports System.IO
Imports System.Drawing.Imaging
Imports System.Collections.Generic
Imports SautinSoft

Module Sample

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

        ' This property is necessary only for registered version.
        'f.Serial = "XXXXXXXXXXX";


        Dim pdfPath As String = "..\..\..\..\simple text.pdf"
        Dim tiffPath As String = Path.ChangeExtension(pdfPath, ".png")

        f.OpenPdf(pdfPath)

        If f.PageCount > 0 Then
            f.ImageOptions.Dpi = 120
            f.ImageOptions.ColorDepth = SautinSoft.PdfFocus.CImageOptions.eColorDepth.BlackWhite1bpp
            ' EncoderValue.CompressionCCITT4 - also makes image black&white 1 bit
            If f.ToMultipageTiff(tiffPath, EncoderValue.CompressionCCITT4) = 0 Then
                System.Diagnostics.Process.Start(tiffPath)
            End If
        End If
    End Sub
End Module

See Also