doc2img.dll Library. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

When i am trying to run doctoprint converter the dll used in the program doc2img.dll is throwing above error"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)". Please five the solution ASAP.

doc2img.dll is a 32bit DLL library, you can't call it from 64bit EXE application, you may compile your source code with x86 platform to try again.

Thanks for the answer. Will it surely fix the issue? To compile my source code what I have to do? My application is already build on 64bit machine and I installed doctopdf converter on 64bit machine but, I took doc2img.dll from 32 bit machine because I did not find this dll after installing converter on 64bit machine. Please let me know where I can find this dll on machine for 64 or let me know if I am wrong somewhere. Please provide your solution ASAP it's very urgent. 

On the 64bit machine, you can use docPrintCom.exe to instead of doc2img.dll, docPrintCom.exe is a COM interface, it can be called from both 32bit and 64bit EXE applications.

You can run a CMD window by administrator privilege first, and run following command line to register docPrintCom.exe on 64bit system,

"C:\Program Files (x86)\docPrint Pro v6.0\docPrintCom.exe" /regsrever

Then you can use following VBS code to call "docPrintComExe.docPrint" to convert office files to PDF files,
strLicenseKey = "XXXX-XXXX-XXXX-XXXX"

set docPrintObj = CreateObject("docPrintComExe.docPrint")
'nRet = docPrintObj.docPrintCOM_DocumentConverter("D:\temp\test.docx", "D:\temp\out.pdf", "-* " & strLicenseKey)
'nRet = docPrintObj.RunCmd("-* " & strLicenseKey & " -i D:\temp\test.docx -o D:\temp\out2.pdf", 1)

'Please run "docPrint_Service.exe" application before you call this function
nRet = docPrintObj.RunCmdViaDocPrintService("-* " & strLicenseKey & " -i D:\temp\test.docx -o D:\temp\out2.pdf", 1, strLicenseKey)


strInputFile = ""
strLicenseKey = "XXXX-XXXX-XXXX-XXXX"

Set fso = CreateObject("Scripting.FileSystemObject")
strFolder = fso.GetParentFolderName(wscript.ScriptFullName)
strOutputFile = strFolder & "\output.pdf"

Set docPrint = CreateObject("DocPrintComExe.docPrint")
nRet = docPrint.docPrintCOM_Register(strLicenseKey, " Company")
nRet = docPrint.RunCmd("-i " & strInputFile & " -o " & strOutputFile & " -* " & strLicenseKey & " -s ""htmlheader=VeryPDF Page Header"" -s ""htmlfooter=VeryPDF Page Footer""", 1)

If (fso.FileExists(strOutputFile)) Then
msg = strOutputFile & " exists."
msg = strOutputFile & " doesn't exist."
End If
MsgBox msg

"docPrintComExe.docPrint" is a COM component, you can arrange it run inside any user account, for example, you can set it run inside Administrator user account to avoid permission problems, please look at following web page for more information,

docPrintCom.exe is "docPrintComExe.docPrint",
VeryPDFComRunCmd.exe is "VeryPDFCom.RunCmd",

They are similar COM components, but not same, you can choose either one.


VN:F [1.9.20_1166]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.20_1166]
Rating: +1 (from 1 vote)
doc2img.dll Library. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B), 10.0 out of 10 based on 3 ratings

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!