cs-pdf-to-image
A x86/x64 simple library based on .net 4.7.2 to convert pdf to image for .net.
This library is a derivation of Mark Redman's work on PDFConvert using Ghostscript gsdll32.dll/gsdll64.dll. The derivation will automatically make the Ghostscript gsdll32/gsdll64 available on computer that does not have it installed, so that that developers do not need to worry whether ghostscript is available on the end user's computer in order for it to work.
The Convert function will automatically determine the processes bitness and use the appropriate Ghostscript gsdll32/gsdll64 as needed.
Current Ghostscript Version: v9.54.0 (2021-03-30)
Install
Install-Package Pdf2Png -Version 2.0.1
Usage
string pdf_filename="sample.pdf";
string png_filename="converted.png";
List<string> errors = cs_pdf_to_image.Pdf2Image.Convert(pdf_filename, png_filename, output_format: cs_pdf_to_image.Pdf2Image.OutputFormat.png256, resolution: 300, first_page: 1, last_page: 3, multiple_files: true);
Output Formats
- pngmono
- png16
- png256
- pnggray
- png16m
- jpeg
- jpeggray