Thread Rating:
  • 1 Votes - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pdf to image conversion in asp.net c#
11-27-2010, 09:35 AM (This post was last modified: 11-27-2010 09:39 AM by nisar87.)
Post: #1
pdf to image conversion in asp.net c#
i have made a small webapplication that convert the pdf files to image very quickly.

actually i was working on postscript from last 2years and using Ghostview utility very heavily. this give lot of support to developers to create such kind of applications with single command. This is free and stable product.

GhostView Link:


in application there are two textboxes, one for pdf input and other for image output.

input should be a complete pdf path

output should be like this

i am generating the command at run-time and then save in batch file. and after that execute the batch file programmtically to get the result.

please feel free to ask and suggest

Refer below link for another solution to convert pdf file into image in asp.net

Attached File(s)
.rar  pdf2image.rar (Size: 47.88 KB / Downloads: 485)

[Image: 2604595733.png]
02-17-2011, 06:52 AM
Post: #2
RE: pdf to image conversion in asp.net c#
I have used this code.Its not working. exe simply runs , but there is no image generated.
02-17-2011, 10:35 AM
Post: #3
RE: pdf to image conversion in asp.net c#
ok thanks for report, i will recheck the code and let you know.

[Image: 2604595733.png]
02-17-2011, 10:40 AM
Post: #4
RE: pdf to image conversion in asp.net c#
Please reply ASAP. this is really very urgent.
02-17-2011, 11:20 AM
Post: #5
RE: pdf to image conversion in asp.net c#
there is no error in code, you need to place the dll and exe in the project as well

please refer this link

[Image: 2604595733.png]
02-17-2011, 11:36 AM
Post: #6
RE: pdf to image conversion in asp.net c#
I have installed both the utilities on my system. But when i run the code it gives me the following error:
"The gsdll32.dll wasn't found in default dlls search pathor is not in correct version (doesn't expose the required methods). Please download at least the version 8.64 from the original website"
02-17-2011, 11:36 AM
Post: #7
RE: pdf to image conversion in asp.net c#
I have placed this dll as well on the root of the project.
02-17-2011, 06:41 PM
Post: #8
RE: pdf to image conversion in asp.net c#
i didn't face such issue earlier, can you provide a screenshot?

[Image: 2604595733.png]
11-25-2013, 09:37 AM
Post: #9
RE: pdf to image conversion in asp.net c#
If you want to convert pdf to image and vice versa then i would recommend you to use the following library, you can get many code samples from their resource page:

03-14-2015, 01:15 PM
Post: #10
RE: pdf to image conversion in asp.net c#
private void btnPDFFile_Click(object sender, EventArgs e)
openFileDialog1.Filter = "PDF File|*.pdf|All files (*.*)|*.*";
openFileDialog1.FilterIndex = 1;
openFileDialog1.RestoreDirectory = true;
openFileDialog1.FileName = string.Empty;

if (openFileDialog1.ShowDialog() == DialogResult.OK)
String fileName = openFileDialog1.FileName;
tbPDFname.Text = fileName;
PDFConvert converter = new PDFConvert();
//Setup the converter
converter.RenderingThreads = -1;
converter.TextAlphaBit = -1;
converter.TextAlphaBit = -1;
converter.OutputToMultipleFile = true;
converter.FirstPageToConvert = -1;
converter.LastPageToConvert = -1;
converter.FitPage = false;
converter.JPEGQuality = 10;
converter.OutputFormat = "png256";
converter.ResolutionX = 500;
converter.ResolutionY = 500;
System.IO.FileInfo input = new FileInfo(fileName);
string directoryPath = System.IO.Path.GetDirectoryName(fileName) + "\\" + Path.GetFileNameWithoutExtension(input.Name);
if (!Directory.Exists(directoryPath))
pdfPath = directoryPath;
string output = string.Format("{0}\\{1}{2}", directoryPath, input.Name, ".png");
converter.Convert(input.FullName, output);

11-10-2015, 02:01 AM (This post was last modified: 11-10-2015 02:02 AM by dasccca.)
Post: #11
RE: pdf to image conversion in asp.net c#
Here is a sample project on MSDN which demonstrates how to convert PDF to Image in C#. Here is the code snippet:

PdfDocument doc = new PdfDocument();
Image img = doc.SaveAsImage(0);

For more details: https://code.msdn.microsoft.com/Operate-PDF-file-in-C-585605ef#content

Possibly Related Threads...
Thread: Author Replies Views: Last Post
  Html to pdf conversion in c# nisar87 13 43,001 09-06-2016 10:30 AM
Last Post: evopdf
  pdf to html conversion in asp.net c# nisar87 9 9,258 04-12-2016 12:21 PM
Last Post: BenJobs
  PDF to Image Conversion in ASP.NET magnum_2007 7 10,898 07-25-2014 09:13 AM
Last Post: alxe_2014
  Html to Pdf conversion in asp.net c# nisar87 7 56,449 06-17-2014 06:31 AM
Last Post: dev_chirs
  Weburl to PDF conversion in asp.net nisar87 21 16,317 07-05-2013 12:42 PM
Last Post: argha_cl

User(s) browsing this thread: 1 Guest(s)