How to call pdf2img.exe from Classic ASP script?

Hi,

I can run a batch file with my commands to convert and split a PDG to jpg.

Works really well.

However I am i implementing from within a Classic ASP script and the program will only output three images.

Any ideas as to why? I have been going around in circles on this.

See below for script:

set wshell = server.CreateObject("WScript.Shell")
call wshell.run ("cmd /c " & "D:\pdf2image\pdf2img.exe -f 1 -l 100 -quality 80 -w 1536 -h 2048 d:\uploaded_pdf\temp.pdf d:\Split_PDF\.jpg")
call wshell.run ("cmd /c " & "D:\pdf2image\pdf2img.exe -f 1 -l 100 -quality 60 -w 225 -h 300 d:\uploaded_pdf\temp.pdf d:\Thumbs_PDF\.jpg")
set wshell = nothing

Regards
--------------------------------------------

image

This problem maybe caused by permission restrictions in Classic ASP script or default SYSTEM user account, you may use VeryPDFComRunCmd COM Component to execute pdf2img.exe application to try again, please refer to more articles about VeryPDFComRunCmd COM Component from following web pages,

http://www.verydoc.com/exeshell.html#VeryPDFComRunCmd_COM_Component

http://www.verydoc.com/blog/verydoc-release-notes-verydoc-releases-an-exe-com-of-verypdfcomruncmd-exe-today-verypdf-exe-com-does-allow-you-to-call-ms-office-and-any-exe-application-from-asp-php-c-net-etc-program-languag.html

You can use following ASP code to call VeryPDFComRunCmd COM Component to try again,

<%

set VeryPDFCom = Server.CreateObject("VeryPDFCom.RunCmd")
dim nRetVal, bRet

strRet = VeryPDFCom.RunCmd2("D:\pdf2image\pdf2img.exe -f 1 -l 100 -quality 80 -w 1536 -h 2048 d:\uploaded_pdf\temp.pdf d:\Split_PDF\out.jpg", 5)

strRet = VeryPDFCom.RunCmd2("D:\pdf2image\pdf2img.exe -f 1 -l 100 -quality 60 -w 225 -h 300 d:\uploaded_pdf\temp.pdf d:\Thumbs_PDF\out.jpg", 5)

Response.Write strRet & vbCrlf

%>

Can you work fine with above ASP code?

VeryPDF

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in PDF to Image Converter and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!