ByteScout PDF Renderer SDK – C# – .NET Core 2.0 – PDF to Multi-page TIFF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Renderer SDK – C# – .NET Core 2.0 – PDF to Multi-page TIFF

ByteScout PDF Renderer SDK – C# – .NET Core 2.0 – PDF to Multi-page TIFF

Program.cs

using System;
using System.Diagnostics;
using Bytescout.PDFRenderer;

namespace PdfToMultipageTiff
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create Bytescout.PDFRenderer.RasterRenderer object instance and register it.
            RasterRenderer renderer = new RasterRenderer();
            renderer.RegistrationName = "demo";
            renderer.RegistrationKey = "demo";

            // Load PDF document.
            renderer.LoadDocumentFromFile(@".\multipage.pdf");

            int startPage = 0;
            int endPage = renderer.GetPageCount() - 1;

            // Save PDF document to black-and-white multi-page TIFF at 120 DPI
            RenderingOptions renderingOptions = new RenderingOptions();
            renderingOptions.TIFFCompression = TIFFCompression.CCITT4;
            renderer.SaveMultipageTiff(@".\multipage.tiff", startPage, endPage, 120, renderingOptions);

            // Cleanup
            renderer.Dispose();

            // Open the output file in default image viewer.
            Process.Start(new ProcessStartInfo(@".\multipage.tiff") { UseShellExecute = true });
        }        
    }
}


  Click here to get your Free Trial version of the SDK

Tutorials:

prev
next