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#.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

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); } } }

ON-PREMISE OFFLINE SDK

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

Explore ByteScout PDF Renderer SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Renderer SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

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

Explore ByteScout PDF Renderer SDK Documentation

Explore Samples

Sign Up for ByteScout PDF Renderer SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next