How to use PDF Compressor SDK/COM? I have gotten "Unexpected error; quitting" when I try to register PDFCompressCom.exe

Hello,

I'm downloading the PDF Compressor SDK/COM from here,

https://www.verydoc.com/dl2.php/pdfcompressor_sdk.zip

but when I unzip the file and try to execute PDFCompressCom.exe (from pdfcompressor_sdk\bin\PDFCompressCom.exe ), I received the error "Unexpected error; quitting".

The same happened when running the install.bat - file (Following the next article),

https://www.verydoc.com/blog/how-to-test-pdf-compressor-sdk-from-c-source-code.html

But without this, when I tried to run the sample in the .zip - file, I'm receiving the error "An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll Additional information: Value cannot be null."

This is because VeryPDFType is null after the line,

System.Type VeryPDFType = System.Type.GetTypeFromProgID("VeryPDF.PDFCompressCom");

Can you send me the fixed .exe, or any workaround, because I'm interested of your products and first want to try it in my applications?

Thanks!
Customer
--------------------------------------------------

image
Please run a cmd window by administrator privilege, and then run following command line, then you will able to register PDFCompressCom.exe properly,

PDFCompressCom.exe /regserver

We have created a new version of "PDF Compressor SDK" to you, please download it from following web page,

https://www.verydoc.com/pdfcompressor.html
https://www.verydoc.com/dl2.php/pdfcompressor_sdk.zip

after you download and unzip it to a folder, please run "install.vbs" file, you will register PDFCompressCom.exe properly, after that, you can run following VBScript code to compress your PDF files easily,

strFolderDir = CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName)

strInFile = strFolderDir & "\sample\test-color-image.pdf"
strOutFile = strFolderDir & "\sample\_out_test-color-image.pdf"
strLicenseKey = "-$ XXXX-XXXX-XXXX-XXXX"
strCmd = "-ci jpx -cidown -cidownres 150 -gi jpx -gidown -gidownres 150 -mi jbig2 -midown -midownres 150 " & strLicenseKey & " """ & strInFile & """ """ & strOutFile & """"
MsgBox strCmd
Set VeryPDFCom = CreateObject("VeryPDF.PDFCompressCom")
strReturn = VeryPDFCom.PDFCompressor(strCmd)
msgbox strReturn

strInFile = strFolderDir & "\sample\test-color.pdf"
strOutFile = strFolderDir & "\sample\_out_test-color.pdf"
strLicenseKey = "-$ XXXX-XXXX-XXXX-XXXX"
strCmd = "-ci jpx -cidown -cidownres 150 -gi jpx -gidown -gidownres 150 -mi jbig2 -midown -midownres 150 " & strLicenseKey & " """ & strInFile & """ """ & strOutFile & """"
MsgBox strCmd
Set VeryPDFCom = CreateObject("VeryPDF.PDFCompressCom")
strReturn = VeryPDFCom.PDFCompressor(strCmd)
msgbox strReturn

strInFile = strFolderDir & "\sample\test-bw.pdf"
strOutFile = strFolderDir & "\sample\_out_test-bw.pdf"
strLicenseKey = "-$ XXXX-XXXX-XXXX-XXXX"
strCmd = "-ci jpx -cidown -cidownres 150 -gi jpx -gidown -gidownres 150 -mi jbig2 -midown -midownres 150 " & strLicenseKey & " """ & strInFile & """ """ & strOutFile & """"
MsgBox strCmd
Set VeryPDFCom = CreateObject("VeryPDF.PDFCompressCom")
strReturn = VeryPDFCom.PDFCompressor(strCmd)
msgbox strReturn

VeryDOC

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!