ByteScout PDF Renderer SDK - C# - Convert PDF To Memory Stream Image - ByteScout

ByteScout PDF Renderer SDK – C# – Convert PDF To Memory Stream Image

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Renderer SDK – C# – Convert PDF To Memory Stream Image

How to convert PDF to memory stream image in C# and ByteScout PDF Renderer SDK

This code in C# shows how to convert PDF to memory stream image with this how to tutorial

Learn how to convert PDF to memory stream image in C# with this source code sample. ByteScout PDF Renderer SDK: the SDK for rendering of PDF into thumbnails and images in high quality. Provides various functions like batch processing, PNG, TIFF output. Can be used from web and desktop applications. It can convert PDF to memory stream image in C#.

You will save a lot of time on writing and testing code as you may just take the C# code from ByteScout PDF Renderer SDK for convert PDF to memory stream image below and use it in your application. Just copy and paste the code into your C# application’s code and follow the instruction. Implementing C# application typically includes multiple stages of the software development so even if the functionality works please test it with your data and the production environment.

Trial version of ByteScout PDF Renderer SDK is available for free. Source code samples are included to help you with your C# app.

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; using System.IO; using System.Drawing; using System.Diagnostics; using Bytescout.PDFRenderer; namespace PDF2PNG { 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"); // Iterate through pages for (int i = 0; i < renderer.GetPageCount(); i++) { using (MemoryStream memoryStream = new MemoryStream()) { // Render document page and save to memory stream renderer.Save(memoryStream, RasterImageFormat.PNG, i, 300); // Create image from memory stream Image pngImg = Image.FromStream(memoryStream); // Save image to file pngImg.Save(i + ".png"); } } // Cleanup renderer.Dispose(); // Open result document in default associated application (for demo purpose) ProcessStartInfo processStartInfo = new ProcessStartInfo("0.png"); 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