ByteScout PDF Renderer SDK - C# - Make Thumbnail from PDF - ByteScout

ByteScout PDF Renderer SDK – C# – Make Thumbnail from PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Renderer SDK – C# – Make Thumbnail from PDF

How to make thumbnail from PDF in C# with ByteScout PDF Renderer SDK

This tutorial will show how to make thumbnail from PDF in C#

Every ByteScout tool contains example C# source codes that you can find here or in the folder with installed ByteScout product. ByteScout PDF Renderer SDK is the library that renders PDF into high quality images and thumbnails. Includes various functions like batch processing, PNG, TIFF output. Can be used from web and desktop applications and you can use it to make thumbnail from PDF with C#.

Fast application programming interfaces of ByteScout PDF Renderer SDK for C# plus the instruction and the code below will help you quickly learn how to make thumbnail from PDF. Just copy and paste the code into your C# application’s code and follow the instruction. You can use these C# sample examples in one or many applications.

You can download free trial version of ByteScout PDF Renderer SDK from our website to see and try many others source code samples for C#.

Try ByteScout PDF Renderer SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

Program.cs
      
using System.Drawing; using System.Diagnostics; using Bytescout.PDFRenderer; namespace MakeThumbnail { static class Program { static void Main() { // 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"); // Get size of the page in Points (standard PDF document units; 1 Point = 1/72") RectangleF rectangle = renderer.GetPageRectangle(0); int width, height; if (rectangle.Width < rectangle.Height) // portrait page orientation { width = -1; // width will be calculated from height keeping the aspect ratio height = 100; } else // landscape page orientation { width = 100; height = -1; // height will be calculated from width keeping the aspect ratio } // Render first page of the document to JPEG image file renderer.Save("thumbnail.jpg", RasterImageFormat.JPEG, 0, width, height); // Cleanup renderer.Dispose(); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("thumbnail.jpg"); processStartInfo.UseShellExecute = true; Process.Start(processStartInfo); } } }

Try ByteScout PDF Renderer SDK today:  60 Day Free Trial (on-premise) or  Web API (on-demand version)

VIDEO

ON-PREMISE VERSION INFORMATION

Get 60 Day Free Trial or Visit ByteScout PDF Renderer SDK Home Page

Explore ByteScout PDF Renderer SDK Documentation

Get ByteScout PDF Renderer SDK Free Training

WEB API

Get Your Free API Key

Explore Web API Documentation

Tutorials:

prev
next