How to call pdf2img.exe from Classic ASP script?


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 ("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 ("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



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,

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?


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

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!