0

How can I convert a PDF into an image in web application?

I am following this link to convert; it is working fine in window applications but in web applications, on,

Clipboard.GetImage().Save(outimg, outPutImageFormat);

It's throwing this exception,

System.NullReferenceException: Object reference not set to an instance of an object.

How I can implement this in Web Application?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Sunny
  • 3,185
  • 8
  • 34
  • 66
  • Did you try looking up the exception? Almost all cases of `NullReferenceException` are the same. Please see "[What is a NullReferenceException in .NET?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-in-net)" for some hints. – John Saunders Oct 13 '13 at 02:31

2 Answers2

3

This is the solution :

1.)https://ghostscriptnet.codeplex.com/ ( a wrapper for the Ghostscript library )

2.) https://ghostscriptnet.codeplex.com/SourceControl/latest#Ghostscript.NET/Ghostscript.NET.Samples/Samples/DeviceUsageSample.cs GhostscriptDevice usage sample

3.)https://ghostscriptnet.codeplex.com/SourceControl/latest#Ghostscript.NET/Ghostscript.NET.Samples/Samples/ProcessorSample.cs Also see this one.

Sunny
  • 3,185
  • 8
  • 34
  • 66
0

How about using this :

LibPDF library converts converts PDF file to an image. Supported image formats are PNG and BMP, but you can easily add more.

Community
  • 1
  • 1
Aneef
  • 3,641
  • 10
  • 43
  • 67