Hubertformin / electron-pos-printer

Electron-pos-printer is a plugin that works to ease paper formatting and printing to thermal printers. it currently supports 80mm, 78mm, 76mm, 58mm, 57mm and 44mm printers thermal printers. it is built with Electron.js and Node.js
Apache License 2.0
318 stars 102 forks source link

Incomplete printing due to low PC configuration Win7 and asynchronous issues #114

Open YoungCodeBro opened 9 months ago

YoungCodeBro commented 9 months ago

情景:由于pc配置较低(win7 1900cpu)和异步问题导致的打印不完整 前置条件:win7 1900cpu或者更低 异常描述:偶然只打前两行,剩余内容未发送到打印机。 临时解决:通过调试我发现在低配置pc上渲染webcontent时是异步的,当页面渲染了前两行时,已经将任务发送到打印机,再将其他行渲染,导致该问题。我对渲染行的进程使用了promise.all暂时解决了该问题,不过现在还是会有该问题,显然这不是持久有效的方法。

Scenario: Incomplete printing due to low PC configuration (Win7 1900 CPU) and asynchronous issues Pre condition: Win7 1900 CPU or lower Exception description: Occasionally only the first two lines were typed, and the remaining content was not sent to the printer. Temporary solution: Through debugging, I found that rendering webcontent on a low configuration PC is asynchronous. When the first two lines of the page are rendered, the task is already sent to the printer and the other lines are rendered, causing this issue. I temporarily resolved the issue by using promise.all for the rendering process, but the issue still persists, Snipaste_2024-02-04_12-21-12 Snipaste_2024-02-04_12-25-55

qBrunoSilva commented 3 months ago

Hi,

I am experiencing a similar issue. In my case, the behavior also occurs randomly, but on higher-spec equipment. Even on newer hardware, the incomplete printing error occasionally persists, making it difficult to pinpoint the exact cause.

I would like to know if you have been able to consistently reproduce the issue. Is there a specific pattern or sequence of actions that triggers the error more frequently? Understanding this might help us better identify the conditions that cause this behavior and possibly find a more permanent solution.