Convierta PDF a JPG / Imágenes sin usar una biblioteca específica de C # [cerrado]
hay un libreBiblioteca C # (.dll) para convertirPDF aimágenes ?
Probé este:
https://code.google.com/p/lib-pdf/
Pero no funciona, recibí este error:
Could not load file or assembly 'libpdf.DLL' or one of its dependencies. The specified module could not be found.
iTextSharp tampoco implementa una función como esa ...
EDITAR:
No utilicé ghost scrpit porque tenías que instalarlo antes en la computadora
Pero ahora encontré una solución: si carga manualmente el dll funciona
http://ghostscriptnet.codeplex.com/discussions/465418
public void PDFToImage(string file, string outputPath, int dpi)
{
string path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
Ghostscript.NET.Rasterizer.GhostscriptRasterizer rasterizer = null;
Ghostscript.NET.GhostscriptVersionInfo vesion = new Ghostscript.NET.GhostscriptVersionInfo(new Version(0, 0, 0), path + @"\gsdll32.dll", string.Empty, Ghostscript.NET.GhostscriptLicense.GPL);
using (rasterizer = new Ghostscript.NET.Rasterizer.GhostscriptRasterizer())
{
rasterizer.Open(file, vesion, false);
for (int i = 1; i <= rasterizer.PageCount; i++)
{
string pageFilePath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(file) + "-p" + i.ToString() + ".jpg");
Image img = rasterizer.GetPage(dpi, dpi, i);
img.Save(pageFilePath, ImageFormat.Jpeg);
}
rasterizer.Close();
}
}