使用pdftron Python将MSG转换为pdf时出错

2024-10-03 23:17:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用convert.ToPdf(doc,filename)将msg文件转换为pdf。 使用此函数可以正确地完成.docx到pdf的转换,但是,我只是在将msg转换为pdf时遇到了一个错误。 右键单击文件时,上下文菜单中也有“打印”选项

这就是我得到的错误:

PDFNet is running in demo mode.

Traceback (most recent call last): File "test.py", line 58, in main() File "test.py", line 44, in main Convert.ToPdf(doc, filename) Exception: An error occurred while converting the file.

Detailed error: Exception: Message: Unable to find printer Conditional expression: success Version : 8.1.0.30521 Platform : Windows Architecture : AMD64 Filename : Convert.cpp Function : trn::PDF::ToPdfPrinterManager::InitPrinter Linenumber : 776

printing to printer \trial_msg.msg AssocQueryString printto: AssocQueryString print : "C:\Program Files\Microsoft Office\Root\Office16\OUTLOOK.EXE" /p "" Created new PDFNet Mutex WaitForSingleObject start WaitForSingleObject End printo: /Local/Temp/pdftron/Trn-17236-1616513476-af5adf11-bd4d-4d40-beec-8f6aad996f18.xps Using HKCU Return value for delete registry: 0 Return value for delete registry: 0 Return value for release mutex: 0 Return value for close mutex: 0 Error destructing ToPdfPrinterManager


Tags: 文件inpytestfordocreturnpdf