ByteScout PDF Suite - C# - Convert pdf to memory stream image with pdf renderer sdk - ByteScout

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

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF 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# with ByteScout PDF Suite

Learning is essential in computer world and the tutorial below will demonstrate how to convert pdf to memory stream image with pdf renderer sdk in C#

ByteScout simple and easy to understand tutorials are planned to describe the code for both C# beginners and advanced programmers. ByteScout PDF Suite is the set that includes 6 SDK products to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript. It can convert pdf to memory stream image with pdf renderer sdk in C#.

Want to quickly learn? This fast application programming interfaces of ByteScout PDF 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. Simply copy and paste in your C# project or application you and then run your app! Want to see how it works with your data then code testing will allow the function to be tested and work properly.

You can download free trial version of ByteScout PDF Suite 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; 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 Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

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

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next