我正在尝试将PDF字节数组转换为项目中的图像。有没有办法将pdf字节数组转换为图像而不使用任何外部库,如Ghost脚本,PDFRasterizer.NET 3.0等
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);
}}