Remote Printing Without VPN: A Secure API Setup Guide
Print to an office, store, or warehouse printer without a VPN or inbound firewall rules. Learn how an outbound agent connects local printers to a cloud API, with a working Python example.
By the PrintScaler team · · 10 min read
You can set up remote printing without VPN access by installing a small agent on a computer that can already print locally, then sending jobs through a cloud printing API. The agent connects outward, so you do not need to expose the printer or open inbound ports on the office router. This works for workflows such as sending invoices from a hosted application to an office laser printer or delivering labels to a warehouse USB printer.
This guide explains the network setup, walks through a working PrintScaler request, and covers the security and failure handling you need before making remote printing part of daily operations.
How remote printing without a VPN works
A local printer usually sits behind a router and firewall. Its private address, such as 192.168.1.50, is meaningful inside that local network, not to your cloud application or a laptop in another city.
A VPN solves this by giving the remote device access to the private network. An agent-based printing service takes a narrower approach: it delivers print jobs through a connection initiated by a computer at the printer location.
With PrintScaler, the path looks like this:
Your application or script
|
| HTTPS print request
v
PrintScaler API
|
| Existing outbound WebSocket connection
v
PrintScaler agent on an office computer
|
| Local operating system print path
v
USB or network printer
The application needs permission to submit a print request. It does not need a route into the office network.
That distinction matters: remote printing access does not have to mean general network access. Your application can send a document to a registered printer without accessing office file shares, remote desktops, or other private services.
What still needs to be installed locally?
For the standard agent-based setup, one computer at the printer location runs the PrintScaler agent. The agent supports Windows, macOS, Linux, and Raspberry Pi.
That computer must already be able to use the printer. A USB printer must be attached to it, while a network printer must be reachable and configured through its operating system. The cloud connection does not replace missing printer drivers or fix local paper and connection problems.
Choose the right approach for your printing task
Remote printing can mean anything from printing an occasional document at home to producing thousands of warehouse labels. Start with the workflow rather than the networking tool.
| Approach | Best fit | Main consideration |
|---|---|---|
| VPN plus existing print infrastructure | Teams that already manage private network access | Requires VPN administration and a working remote print path |
| Remote desktop into an office computer | Occasional manual printing | Requires an interactive session and access to that computer |
| Cloud API plus local agent | Automated application-to-printer workflows | Requires an agent computer at the printer location |
| Supported Epson direct connection | Compatible receipt printers in POS environments | Requires a model with Server Direct Print support |
| Public printer address with port forwarding | Specialized, deliberately managed network setups | Exposes an inbound network path that needs careful protection |
A printing API is not a remote desktop replacement. Its strength is letting software submit a specific document to a specific printer without someone opening the file and clicking Print.
For occasional personal printing, an existing remote desktop connection may be enough. For invoices, shipping documents, or other repeated business tasks, an API gives your application a clearer submission and tracking workflow.
Step 1: Prove that the printer works locally
Before configuring anything in the cloud, print a test page from the computer that will run the agent.
Check the following:
- The printer is installed and visible to the operating system.
- A local test page prints successfully.
- The expected paper size and tray are available.
- A USB connection remains stable, or the network printer is consistently reachable.
- The computer can stay powered on during the required printing hours.
For a network printer, a changing local address can break an otherwise healthy setup. Consider a DHCP reservation or another address-management approach consistent with your IT policy.
For a shared office computer, also check sleep settings. A computer that sleeps every afternoon cannot receive and process jobs while asleep, even if its attached printer is switched on.
Do not skip this baseline. If the operating system cannot print locally, troubleshooting API authentication will not solve the underlying problem.
Step 2: Install and pair the PrintScaler agent
Get the appropriate installer from the PrintScaler agent download page, install it on the printer-connected computer, and enter the pairing code in the dashboard to link that computer.
After pairing:
- Confirm that the computer appears in the dashboard.
- Find the printer you intend to use.
- Use the printer’s test page button.
- Record the printer ID for your application configuration.
The PrintScaler agent starts automatically after reboots, updates itself, and reports printers and their status.
Do you need a static public IP address?
Not for this agent-based setup. The office computer establishes an outbound WebSocket connection, so the router does not need to forward inbound printing traffic to it.
This also avoids depending on the office’s public IP address as the printer’s identity. Your application addresses a registered printerId, not the router’s current address.
On tightly controlled corporate networks, outbound connections may still be restricted. Have the network administrator review the required connectivity rather than disabling security controls. “No inbound ports” does not mean “ignore the organization’s outbound access policy.”
Step 3: Send a PDF to the remote printer
PrintScaler accepts print jobs at:
POST https://api.printscaler.com/v1/printjobs
You can authenticate with an API key as the HTTP Basic username or with a Bearer token. The example below uses Bearer authentication and Python’s standard library, so there is no additional Python package to install.
Set these environment variables in your shell or application environment:
export PRINTSCALER_API_KEY='psk_replace_with_your_key'
export PRINTSCALER_PRINTER_ID='123'
export PRINT_PDF_PATH='./invoice-1042.pdf'
export PRINT_JOB_KEY='production:invoice:1042:original:v1'
Replace the printer ID with the one from your dashboard. The job key should identify this specific business printing action; do not reuse the example value for unrelated documents.
Save this as remote_print.py:
import base64
import json
import os
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
pdf_path = Path(os.environ['PRINT_PDF_PATH'])
pdf_content = base64.b64encode(pdf_path.read_bytes()).decode('ascii')
payload = {
'printerId': int(os.environ['PRINTSCALER_PRINTER_ID']),
'contentType': 'pdf_base64',
'content': pdf_content,
'title': pdf_path.name,
}
request = Request(
'https://api.printscaler.com/v1/printjobs',
data=json.dumps(payload).encode('utf-8'),
headers={
'Authorization': 'Bearer ' + os.environ['PRINTSCALER_API_KEY'],
'Content-Type': 'application/json',
'X-Idempotency-Key': os.environ['PRINT_JOB_KEY'],
},
method='POST',
)
try:
with urlopen(request, timeout=30) as response:
print(response.status)
print(response.read().decode('utf-8'))
except HTTPError as error:
print('HTTP error:', error.code)
print(error.read().decode('utf-8'))
raise SystemExit(1)
except (URLError, TimeoutError) as error:
print('Submission outcome may be unknown:', error)
print('Keep the same job key and payload for any retry.')
raise SystemExit(1)
Run it with:
python3 remote_print.py
Check the returned response and locate the job in the dashboard. An accepted API request is not the same as paper being physically produced; job tracking comes next.
Base64 or a PDF URL?
This example uses pdf_base64, which sends the PDF content in the request. That avoids making a local file accessible through a public URL, though base64 encoding increases the payload size.
Use pdf_uri when the document is already available at a URL the service can retrieve. A path such as C:\Invoices\invoice.pdf or http://192.168.1.10/invoice.pdf is not a cloud-accessible document URL.
For signed URLs, account for their expiration and the document retrieval lifecycle. Review the print jobs API reference before choosing how to supply documents.
Step 4: Track job progress instead of assuming success
A successful submission tells your application that its request was accepted. It does not prove that the printer has paper, the correct stock is loaded, or the output has reached the person who needs it.
PrintScaler exposes job states including:
newsent_to_clientqueuedin_progressdoneerrorcancelledexpired
Use the job history and print job state documentation to distinguish submission, processing, and terminal outcomes. Do not treat these names as a guarantee that every job will follow one fixed sequence.
For production systems, store the submitted job’s identifier alongside the business record. Support staff should be able to start with an invoice or shipment number and find its corresponding print attempt.
For event-driven updates, PrintScaler provides signed webhooks, including printjob.state and computer connection events. Verify HMAC-SHA256 signatures and make your event handler safe to process retried deliveries.
Also distinguish software completion from physical verification. If a workflow requires proof that a shipping label was applied to the correct carton, add a scan or operator confirmation. A print-job status cannot replace that warehouse check.
Handle offline computers, retries, and stale documents
The main reliability challenges are not unique to VPN-free printing. They come from coordinating a cloud application with equipment that can lose power, run out of paper, or disconnect.
Decide which jobs should wait
PrintScaler queues jobs while a computer is offline and sends them when it reconnects. Jobs expire after a configurable time.
Choose expiration according to the business task:
- An invoice may still be useful when the office reopens.
- A packing slip may become stale after the shipment is cancelled.
- A receipt or time-sensitive operational ticket may be inappropriate to print hours later.
Avoid creating a second application queue that blindly resubmits documents already accepted by PrintScaler. Otherwise, reconnecting a computer can produce both the original queued job and a newly submitted duplicate.
Keep retry identity stable
A timeout is ambiguous: the API may have accepted the request even though your application did not receive the response.
Use X-Idempotency-Key so retrying the same request does not print twice. Persist the key and the document associated with it before submission, then reuse both for retries of that same action.
A deliberate reprint is a new action and should receive a new key. For a deeper implementation pattern, see the guide to preventing duplicate print jobs.
Throttle batches deliberately
PrintScaler’s rate limit is 10 requests per second, with a burst of 30. If a batch process releases hundreds of documents, use a controlled worker queue rather than starting every request simultaneously.
Treat rate-limit responses and transient failures differently from invalid requests. Repeatedly submitting a malformed payload will not fix it.
Secure the workflow without exposing the printer
Removing a VPN does not remove the need for access control. It changes where you enforce it.
Keep API credentials on a trusted backend or in a protected script environment. Do not embed an API key in browser JavaScript, a public repository, or a mobile application bundle that users can inspect.
Your application should also decide which printer a user is allowed to use. Do not accept an arbitrary printerId from a browser and forward it without checking authorization. Map business locations or workstations to approved printer IDs on the server.
Other practical safeguards include:
- Keep documents and credentials out of routine request logs.
- Use non-sensitive job titles where possible.
- Restrict access to the computer running the agent.
- Review document retention and handling requirements for regulated data.
- Use a protected physical output location for confidential documents.
For multiple sites, maintain an explicit location-to-printer mapping rather than relying on printer names alone. The multi-location printing guide covers that routing problem in more detail.
Should you forward a printer port instead?
PrintScaler also supports direct access to network receipt printers through a public IP address or dynamic DNS name with port forwarding. That is a different architecture from the outbound-agent approach described here.
Do not expose a printer’s raw printing port simply to avoid installing an agent. An internet-reachable printer endpoint needs deliberate security controls and network review. For a typical private office printer, the agent approach avoids creating that inbound path.
Troubleshoot the connection in layers
When a document does not print, work through the path in order:
| Symptom | First check |
|---|---|
| Local test page fails | Printer connection, driver, paper, and local queue |
| Computer appears offline | Power, sleep state, agent operation, outbound connectivity |
| Dashboard test prints but API request fails | API credentials, printer ID, request body, and response |
| Job waits while the computer is offline | Connection recovery and job expiration policy |
| Output has the wrong size or tray | PDF dimensions, printer capabilities, and print options |
| Duplicate output appears | Application retries, repeated business events, and idempotency keys |
For PDF output, PrintScaler supports options such as copies, duplex, paper size, tray, DPI, color, fit to page, and page ranges. Printer capabilities are readable through the API, so inspect the target device rather than assuming every printer supports the same options.
Test with a simple known-good PDF first. Then add application-generated documents, paper selection, and other options one at a time.
Start with one printer and one real document
Remote printing without VPN access works best when you keep the boundaries clear: the local computer handles printer connectivity, PrintScaler delivers jobs, and your application controls authorization, document identity, and business rules.
The Free plan includes 100 print requests per month and one computer, with all printers on that computer. Billing is per print request, not per page; review the current plans when estimating production volume.
Create a free PrintScaler account, pair one computer, and print a representative document. Once that path works, add job tracking, stable retry keys, and an expiration policy before expanding to more users or locations.
Frequently asked questions
Can I print to an office printer from home without a VPN?
Yes. With an agent-based service such as PrintScaler, a computer at the office maintains an outbound connection and receives jobs submitted through the API. The office computer must be online and able to print locally.
Can I print to a USB printer over the internet?
Yes, if the USB printer is connected to a supported computer running the PrintScaler agent and works through that computer’s operating system. Your remote application submits jobs to the registered printer ID rather than connecting directly to the USB device.
Do I need port forwarding or a static IP for remote printing?
Not with the PrintScaler agent. It uses an outbound WebSocket connection, so the agent-based setup does not require inbound port forwarding or a static public IP address. Restricted corporate networks may still require administrator approval for outbound connectivity.
What happens if the remote printer computer is offline?
PrintScaler queues jobs while the computer is offline and prints them when it reconnects, subject to the configured expiration time. Choose an expiration policy that prevents outdated documents from printing after they are no longer useful.
Can I print remotely without leaving a computer on?
The standard agent-based setup requires its computer to be online to process jobs. Supported Epson receipt printers with Server Direct Print can connect to PrintScaler without a computer, but this capability does not apply to every printer.
Is an accepted print request proof that the document printed?
No. Track the job’s subsequent states and history rather than treating API acceptance as physical completion. Workflows that require proof of correct output or placement should also use an operator check or barcode scan.