Print from a cloud app to an office without a VPN
An app on AWS or Azure can print to a branch office by posting a job. The office runs the agent. You do not merge the networks for printing.
For IT teams who only need printing, not a site-to-site VPN
Overview
A site-to-site VPN is the usual way to let a cloud server open port 9100 on a branch printer. For printing, you can skip that path. The branch PC runs the agent and connects outbound. The cloud app posts HTTPS to the API.
The branch still needs a PC that stays on, with the printer installed. A locked-down network must allow the agent outbound to the API host. It does not need an inbound rule.
Map each branch to printer codes in your app. The API does not know your office codes.
Create the job with POST /v1/print-jobs, an Authorization: Bearer header, printer_code, content_type pdf or raw, and exactly one of content or content_url. The free plan is 100 jobs a month on one computer.
Integration steps
- 01
Decide the printer before the click
Map the station, store, or line to a printer_code from GET /v1/printers. Do not ask the operator to pick a dialog.
- 02
Create the document in your system
PDF for driver printers, raw ZPL or ESC/POS when the device speaks that language.
- 03
POST when the business event happens
Pack, pay, check-in, or scan. Not on every autosave. Use the business id as Idempotency-Key.
- 04
Show the job result where the work is
queued is not done. Surface AGENT_OFFLINE and PRINT_ERROR to the person at the bench.
Node.js
// Branch office document
const res = await fetch('https://api.printbase.cloud/v1/print-jobs', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': idempotencyKey,
},
body: JSON.stringify({
printer_code: Number(process.env.PRINTER_CODE),
content_type: 'pdf',
content: pdf.toString('base64'),
copies: 1,
}),
});
if (!res.ok) throw new Error(`PrintBase ${res.status}: ${await res.text()}`);
const job = await res.json();
// { id: "job_abc", status: "queued" }
Details for this setup
What the VPN might still be for
File shares and directory services are unrelated. This removes the VPN only as a printer path.
Choose the API host
Default is https://api.printbase.cloud. The desktop app can select https://cn.api.printbase.cloud for the China node. Same paths.
Questions
Does the printer get a public IP?
No. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Can a serverless function print?
Yes, if it can do HTTPS and has the key. It never connects to the office LAN.
How do we audit?
Keep the job id in the business system. GET returns status, not the document body.
Agent identity?
The agent signs in with an API key or an account on that organization. Use separate keys per branch if you need to revoke one.
Free plan: 100 jobs a month on one computer, no card.