Chrome extensions for silent print?

后端 未结 4 835
遥遥无期
遥遥无期 2020-12-13 01:31

I have made a silent print web application that prints a PDF file. The key was to add JavaScript to the PDF file that silently print itself.

To do this I open the PD

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 02:03

    This used to be possible using browser plugins (e.g. Java + NPAPI, ActiveX) but has been blacklisted by most browsers for several years.

    If interested in modern solutions that use similar techniques, the architecture usually requires the following:

    1. WebSocket, HTTP or Custom URI connection back to localhost
    2. API that talks through web transport (JavaScript or custom URI scheme) to an app running locally.

    A detail of projects (several of them are open source) that leverage these technologies are available here: https://stackoverflow.com/a/28783269/3196753

    Since the source code of these projects can vary (hundreds of lines to tens-of-thousands of lines), a code snippet would be too large unless a inquiring about a specific project's API.

    Side note: Some technologies offer dedicated cloud resources, which add convenience at the expense of potential latency and privacy. At the time of writing this, the most popular "free" cloud solution -- Google Cloud Print -- is slated to be retired in December 2020.

提交回复
热议问题