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.

Try ByteScout PDF Renderer SDK today: Get 60 Day Free Trial or sign up for Web API

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

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

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF Renderer SDK page

Explore ByteScout PDF Renderer SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next