Печать из 1C c сервере через ""Wscript.Shell""
Здравствуйте. Есть реализация печати, когда с терминала сбора данных на сервер приходит пакет и формируется документ, выводящийся на печать, через утилиту "PDFtoPrinter". Сам принтер установлен на сервере 1С.
Изредка бывает, что печать не срабатывает и процесс "DFtoPrinter.exe" зависает в задачах на сервере windows.
Возможно проблема в софте или в чем-то еще. Специально воспроизвести ошибку не удается.
Посоветуйте, есть ли более отказоустойчивые способы (может быть софт) для реализации такого рода печати ?
//...
WshShell = Новый COMОбъект("Wscript.Shell");
СтрокаКоманды = """C:\PDFtoPrinter.exe"" " + """" + ИмяПечатногоФайла + """ """ + ИмяПринтера + """";
WshShell.run(СтрокаКоманды)
Изредка бывает, что печать не срабатывает и процесс "DFtoPrinter.exe" зависает в задачах на сервере windows.
Возможно проблема в софте или в чем-то еще. Специально воспроизвести ошибку не удается.
Посоветуйте, есть ли более отказоустойчивые способы (может быть софт) для реализации такого рода печати ?
По теме из базы знаний
Ответы
Подписаться на ответы
Инфостарт бот
Сортировка:
Древо развёрнутое
Свернуть все
Любой линух печатает PDF встроенными утилитой печати lpr. У меня было 5 виртуальных серверов с Debian, которые печатали в день по 5к страниц, и за несколько лет не было ни одного сбоя. Хотя... Кому я это все рассказываю.
(8)
Troubleshooting: If the program doesn't print your document, or if the the PDF-XChange Viewer opens when you run PDFtoPrinter.exe, then you can help to identify the problem and possibly solve it. Either rename PDFtoPrinter.exe to a name that includes "debug", perhaps PDFtoPrinter-debug.exe (or make a copy of the program and rename the copy so that its name includes "debug"). Alternatively, run the program (with its original name) with the command-line switch /debug (no quotation marks) added to whatever command-line switches you already use. When you run the program, using either of these methods, it will copy the PDF-Xchange.exe print command to the Windows clipboard; you can then paste this command into a Windows command prompt to see what may have gone wrong.
Troubleshooting: If the program doesn't print your document, or if the the PDF-XChange Viewer opens when you run PDFtoPrinter.exe, then you can help to identify the problem and possibly solve it. Either rename PDFtoPrinter.exe to a name that includes "debug", perhaps PDFtoPrinter-debug.exe (or make a copy of the program and rename the copy so that its name includes "debug"). Alternatively, run the program (with its original name) with the command-line switch /debug (no quotation marks) added to whatever command-line switches you already use. When you run the program, using either of these methods, it will copy the PDF-Xchange.exe print command to the Windows clipboard; you can then paste this command into a Windows command prompt to see what may have gone wrong.
Использовали Суматру, работает стабильно:
или более правильный вариант:
ЗапуститьПриложение("""D:\Program Files\SumatraPDF\SumatraPDF.exe"" -print-to """+Принтер+""" """+ИмяФайла+"""");
или более правильный вариант:
Shell = Новый COMОбъект("WScript.Shell");
Shell.Run("SumatraPDF.exe -print-to """+Принтер+""" """+ИмяФайла+"""");
Для получения уведомлений об ответах подключите телеграм бот:
Инфостарт бот