因为项目需要,需要用 php 调用 python 进行 pdf 打印,
php 通用 exec()调用 python:
$c = exec("C:\Python34\python.exe D:\webroot\api\web_print\pg_print.py ",$out,$res);
pg_print.py 用
win32api.ShellExecute(0,'print',self.pdf_file_name,win32print.GetDefaultPrinterW(),".", 0)
实现打印,
self.pdf_file_name 为打印的 pdf 绝对路径
用 python 测试是正常打印的,
但通用 php 调用 python 打印,就是没有反应,也无报错,
希望有了解的大神帮忙!谢啦!!
php 通用 exec()调用 python:
$c = exec("C:\Python34\python.exe D:\webroot\api\web_print\pg_print.py ",$out,$res);
pg_print.py 用
win32api.ShellExecute(0,'print',self.pdf_file_name,win32print.GetDefaultPrinterW(),".", 0)
实现打印,
self.pdf_file_name 为打印的 pdf 绝对路径
用 python 测试是正常打印的,
但通用 php 调用 python 打印,就是没有反应,也无报错,
希望有了解的大神帮忙!谢啦!!