ByteScout Premium Suite - C# - Convert pdf to memory stream image with pdf renderer sdk - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Premium Suite – C# – Convert pdf to memory stream image with pdf renderer sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – C# – Convert pdf to memory stream image with pdf renderer sdk

How to convert pdf to memory stream image with pdf renderer sdk in C# using ByteScout Premium Suite

Learn to code in C# to convert pdf to memory stream image with pdf renderer sdk with this step-by-step tutorial

These sample source codes on this page below are displaying how to convert pdf to memory stream image with pdf renderer sdk in C#. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording and you can use it to convert pdf to memory stream image with pdf renderer sdk with C#.

Want to quickly learn? This fast application programming interfaces of ByteScout Premium Suite for C# plus the guidelines and the code below will help you quickly learn how to convert pdf to memory stream image with pdf renderer sdk. This C# sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample C# codes.

Our website gives trial version of ByteScout Premium Suite for free. It also includes documentation and source code samples.

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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite 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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next