Question

I am trying to use ImageResizer (http://imageresizing.net/) installed as COM object to thumbnail a PDF file.

I have got imageresizer successfully working with a JPG file, and moved onto using the PDF render plug in.

Classic ASP code

Set c = Server.CreateObject("ImageResizer.Configuration.Config")
set p = Server.CreateObject("ImageResizer.Plugins.PdfRenderer.PdfRendererPlugin")
p.Install(c)
c.BuildImage "d:\temp\wibble.pdf", "d:\temp\tractor-rotated.jpg", "format=jpg&rotate=45"

Error Message

ImageResizer.Plugins.PdfRenderer error '80131509'

Ghostscript native library for this platform not found: gsdll32.dll

/resize.asp, line 11

(line 11 is p.Install(c))

Now I have downloaded and installed Ghostscript. I have put the gsdll32.dll and gsdll64.dll in the /bin directory

But it will not work.

What am I doing wrong?

UPDATE BASED ON SUPPLIED COMMENTS.

I have imageresizer installed and working successfully using Classic ASP; I have resized and rotated a plain old .jpg file fine; the issues I am having are with the PDF Rendering plug in... that too seems to be working it is just it is looking for Ghostscript which does not seem to be installed..

Re: Ghostscript. I have run the Ghostscript install program. It seems Ghostscript is actually installed but that the PDF render plug in cant find it.

I copied it to the /bin folder because that is part of the install instructions and I wondered if that is where it might be looking (trying to eliminate variables)

I have created a standalone project to test this and have run the Classic ASP apppool in both 64 and 32 bit modes to again eliminate variables.

But I am still stuck with the error as defined above.

Was it helpful?

Solution

From the update I eliminated most possibilities; I also ran Ghostscript from the supplied documentation so I knew that ImageResizer and Ghostscript were both installed and working but not talking finding each other ....

So the fix is ... add the Ghostscript bin directory(s) to your PATH environment variable, that way ImageResize can find it and after a reboot it all worked. In my case I added

;C:\Program Files\gs\gs9.10\bin;C:\Program Files (x86)\gs\gs9.10\bin to PATH

I have not found this documented anywhere else; so I hope it helps someone else

OTHER TIPS

You can't just drop your dll into the bin folder the way you can in asp.net. With classic asp third party components you need to register the component (which the installation process should have done for you anyway), then you need to give your IUSR account read/execute permission on the registered dll. I haven't used Ghostscript but at a guess look in Program Files/Ghostscript/ or Program Files(x86)/Ghostscript. Another thing to watch out for in Classic is that if you're using a 32 bit component you need to enable 32 bit applications in your app pool

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top