Convert PDF to Multipage TIFF in C# and Visual Basic .NET with PDF Renderer SDK

The scripts below show how to convert PDF to multi-page TIFF image in C# and Visual Basic .NET using Bytescout PDF Renderer SDK.


C#

using System;
 
using Bytescout.PDFRenderer;
 
 
namespace PDF2TIFF
{
	class Program
	{
		static void Main(string[] args)
		{
			// Create an instance of Bytescout.PDFRenderer.RasterRenderer object and register it.
			RasterRenderer renderer = new RasterRenderer();
			renderer.RegistrationName = "demo";
			renderer.RegistrationKey = "demo";
 
			// Load PDF document.
			renderer.LoadDocumentFromFile("multipage.pdf");
 
            // page to start from 
            int StartPageIndex = 0;
            // page to end on
            int EndPageIndex = renderer.GetPageCount() - 1;
 
            renderer.RenderPageRangeToMultipageTIFFFile(StartPageIndex, EndPageIndex, TIFFCompression.LZW, "multipage.tiff");
 
			// Open the first output file in default image viewer.
            System.Diagnostics.Process.Start("multipage.tiff");
		}
	}
}

VB.NET

Imports Bytescout.PDFRenderer
 
 
Class Program
	Friend Shared Sub Main(args As String())
 
        ' Create an instance of Bytescout.PDFRenderer.RasterRenderer object and register it.
		Dim renderer As New RasterRenderer()
		renderer.RegistrationName = "demo"
		renderer.RegistrationKey = "demo"
 
		' Load PDF document.
        renderer.LoadDocumentFromFile("multipage.pdf")
 
        ' define page to start from
        Dim StartPageIndex As Integer = 0
        ' define page to end on
        Dim EndPageIndex As Integer = renderer.GetPageCount() - 1
 
        ' Render PDF to TIFF image file.
        renderer.RenderPageRangeToMultipageTIFFFile(StartPageIndex, EndPageIndex, TIFFCompression.LZW, "multipage.tiff")
 
        ' Open the first output file in default image viewer.
        System.Diagnostics.Process.Start("multipage.tiff")
	End Sub
End Class
Filed in: PDF Renderer SDK