Convert many TIFF files to PDF files in C# and VB.Net

Convert many TIFF files to PDF files
in C# and VB.Net.


Complete code

using System;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;

namespace Sample
{
    class Test
    {
        static void Main(string[] args)
        {
            // Convert many TIFF files to PDF files in the same folder.
            SautinSoft.PdfVision v = new SautinSoft.PdfVision();

            DirectoryInfo tiffDir = new DirectoryInfo(@"..\..\");
            FileInfo[] tiffFiles = tiffDir.GetFiles(@"*.tif*");

            foreach (FileInfo tiffFile in tiffFiles)
            {
                string pdfFile = Path.ChangeExtension(tiffFile.FullName, ".pdf");
                v.ConvertImageFileToPDFFile(tiffFile.FullName, pdfFile);
            }
            // Open the folder with PDF.
            System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(tiffDir.FullName) { UseShellExecute = true });
        }
    }
}

Download.

        
            Imports System.IO

Namespace Sample
    Friend Class Test

        Shared Sub Main(ByVal args() As String)

            ' Convert many TIFF files to PDF files in the same folder.
            Dim v As New SautinSoft.PdfVision()

            Dim tiffDir As New DirectoryInfo("..\..\")
            Dim tiffFiles() As FileInfo = tiffDir.GetFiles("*.tif*")

            For Each tiffFile As FileInfo In tiffFiles
                Dim pdfFile As String = Path.ChangeExtension(tiffFile.FullName, ".pdf")
                v.ConvertImageFileToPDFFile(tiffFile.FullName, pdfFile)
            Next tiffFile

            ' Open the folder with PDF.
            System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(tiffDir.FullName) 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:



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.