我从qt wiki上读到的内容中得到以下代码:
auto pdfObject = new QAxObject("AxAcroPDFLib.AxAcroPDF");
qDebug() << pdfObject->dynamicCall("LoadFile(const QString)", "test.pdf");
qDebug() << pdfObject->dynamicCall("Print()");
但是当我运行它时,我收到了消息:
CoCreateInstance failure (Class not registered)
QAxBase::setControl: requested control AxAcroPDFLib.AxAcroPDF could not be instantiated
我搜索了AcroPDF.dll
所需的dll,并在C:\Program Files (x86)\Common Files\Adobe\Acrobat\ActiveX
中找到并安装了Adobe Acrobat Reader DC。我能做些什么使这个有效?
答案 0 :(得分:0)
由于缺少注册,可能找不到COM对象。确保已注册ActiveX DLL。使用regsvr32。您可能需要管理员权限才能运行它。命令行是:
regsvr32 AcroPDF.dll