Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huysentruitw/print-it
Windows service for printing PDF files to a local or network printer in the background
https://github.com/huysentruitw/print-it
api api-service background pdf pdfium printing windows-service
Last synced: 11 days ago
JSON representation
Windows service for printing PDF files to a local or network printer in the background
- Host: GitHub
- URL: https://github.com/huysentruitw/print-it
- Owner: huysentruitw
- License: mit
- Created: 2019-12-15T20:54:55.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2023-11-06T10:55:13.000Z (about 1 year ago)
- Last Synced: 2024-07-04T16:17:05.570Z (4 months ago)
- Topics: api, api-service, background, pdf, pdfium, printing, windows-service
- Language: C#
- Size: 4.12 MB
- Stars: 83
- Watchers: 8
- Forks: 41
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# print-it
Windows service for printing PDF files to a local or network printer in the background.
## Usage instructions
1. Download the [latest release](https://github.com/huysentruitw/print-it/releases/latest)
2. Extract the package to f.e. C:\print-it
3. Create print-it as a Windows service from an elevated command line: `sc create "PrintIt" binPath="C:\print-it\PrintIt.ServiceHost.exe" start=auto`
4. Start the service from the command line: `sc start PrintIt`
5. Check if the service is listening on port 7000 by running: `netstat -a | find ":7000"`## API
By default, _PrintIt.ServiceHost_ is listening on http://localhost:7000. The endpoint is configurable in _appsettings.json_.
#### [GET] /printers/list
List all available printers on the system.
#### [POST] /printers/install?printerPath=\\\\REMOTE_PC_NAME\\PRINTER-NAME
Install the network printer with the UNC-path `\\REMOTE_PC_NAME\PRINTER-NAME`.
#### [POST] /print/from-pdf
To print a PDF on a given printer, post a multipart form to this end-point with the following fields:
Field Name | Required | Content
------------ | ------------------ | ---------
PdfFile | :heavy_check_mark: | The PDF file to print (Content-type: application/pdf)
PrinterPath | :heavy_check_mark: | The UNC-path of the printer to send the PDF to
PageRange | | An optional page range string (f.e. "1-5", "1, 3", "1, 4-8", "2-", "-5")
Copies | | An optional number of copies (defaults to 1)## PDFium
This project uses the [PDFium library](https://pdfium.googlesource.com/) for rendering the PDF file which is licensed under Apache 2.0, see [LICENSE](pdfium-binary/LICENSE).
The version included in this repository under the folder `pdfium-binary` was taken from https://github.com/bblanchon/pdfium-binaries/releases/tag/chromium/4194.