Convert PDF byte array to jpg image in C #

I am trying to convert a PDF byte array to image in a project. Is there any way to convert PDF byte array to image without using any external libraries like Ghost script, PDFRasterizer.NET 3.0, etc.

 using (FileStream file = File.OpenRead(@"D:\FileFolder\file.pdf")) // in file
{
      var bytes = new byte[file.Length];
      file.Read(bytes, 0, bytes.Length);

       byte[] pngBytes = bytes; // need to convert image type and assign
       using (var outFile = File.Create(@"D:\FileFolder\file.png")) // out file
       {
             outFile.Write(pngBytes, 0, pngBytes.Length);
       }}

      

+3


source to share





All Articles