🧾 VSI Print Agent – API Documentation

Base URL: http://localhost:8765

GET /version

Returns the version of the Print Agent.

GET http://localhost:8765/version
{
  "Version": "1.0.3"
}

GET /defaultprinter

Returns the default printer name.

GET http://localhost:8765/defaultprinter
{
  "defaultPrinter": "HP LaserJet P1006"
}

GET /printers

Returns a list of installed printers.

GET http://localhost:8765/printers
[
  { "name": "HP LaserJet P1006", "status": "online" },
  { "name": "Microsoft Print to PDF", "status": "online" }
]

GET /history

Returns a log of previous print attempts.

GET http://localhost:8765/history
[
  "[2025-06-01 14:33] User: John, Printer: HP LaserJet, File: document1.pdf, Attempt: 1",
  "[2025-06-01 14:35] User: Alice, Printer: Canon Pixma, File: file.pdf, Attempt: 1"
]

POST /print

Sends a PDF document to a specified printer.

POST http://localhost:8765/print
Content-Type: application/json

{
  "pdfBase64": "JVBERi0xLjQKJcfs...",
  "printerName": "HP LaserJet P1006",
  "userId": "john.doe"
}
Response:
"Printed"

GET /quit

Stops the print agent gracefully.

GET http://localhost:8765/quit
"VSI Print Agent stopped..."

Notes

  • All endpoints are local only and require no authentication.
  • Retries up to 3 times on failed prints.
  • Works with CORS by default for browser usage.