Skip to content

Print agent setup

For IT administrators

The print agent is a small program for the Windows PC next to your card printer. A web browser cannot reach a printer plugged into a PC or sitting on your local network, so the agent does it: it takes print jobs from CardOffice, sends them to the printer, and reports what happened.

The agent prints through your printer’s own Windows driver, so it works with most card printers. The Zebra ZXP Series 7 has the fullest support, including ribbon readings and magnetic stripe encoding. For other printers, see Other card printers. To print from Linux, talk to us.

CardOffice Your print room
────────── ───────────────
print queue ◄──── HTTPS, outbound only ──── print agent ── USB or network ──► card printer
──── card artwork ───────────►
◄─── printer status ─────────

The agent only makes outbound HTTPS connections. There is no inbound port to open and no VPN to set up.

  • The printer’s Windows driver is installed, and Windows can print a test card
  • The printer has card stock and a ribbon loaded
  • You have an enrolment token for a print agent, made for your organisation. See Get an enrolment token, below
  • You have your organisation code, such as acme-polytechnic. See Find your organisation code, below
  • On a managed PC, IT has checked what the agent needs

Print a test card from Windows before installing the agent. If Windows cannot print, the agent cannot either.

The organisation code is your organisation’s short name in CardOffice, such as acme-polytechnic. The print agent asks for it during installation, so its printers join your organisation and nobody else’s. It is all lower case, with hyphens instead of spaces.

It is shown in three places in the portal:

Where Who can see it
Settings → General, at the top under Organisation Company admins
Settings → Integrations → Agent enrolment tokens, above the list of tokens Company admins
Beside a new enrolment token, the moment it is created The admin who created it

It is not in the portal’s web address: every organisation signs in at the same address. If you are installing the agent and are not an administrator, ask the administrator who gives you the enrolment token to send the code with it. The code never changes, so it is safe to write down beside the print PC.

The enrolment token is a one-time code that lets this PC join your organisation. The agent swaps it for its own permanent credential the first time it connects, so the token is only needed during installation.

An administrator of your organisation (a company admin) makes the token in the portal. If you are installing the agent but are not an administrator, ask one to make a token and send it to you. Staff and print operator accounts cannot see the page.

  1. In the portal, go to Settings → Integrations.

  2. Find Agent enrolment tokens and choose Create token.

  3. Fill in the form:

    Field What to choose Why
    Label Where it is going, such as “Main print room PC” It is the only way to tell tokens apart in the list later
    Agent type Print agent only A token made for the encoder agent is refused by the print agent. “Either” also works, but print only is safer
    Valid for (days) Long enough for the installation: the default 7 is usually right It stops working after this, whether used or not. 30 days at most
    Number of machines 1 for one print PC, or the number of print PCs you are setting up today Each PC that enrols uses one. When they are used up, the token stops working
  4. Choose Create token. The token is shown once, with your organisation code under it. Copy both straight away and give them to the person installing the agent; send the token over a channel you trust, with the same care as a password. CardOffice keeps only a fingerprint of the token, so it cannot be shown again.

What you see What to do
The token was lost before it was used Revoke it in the list and create another
“That enrolment token is not correct.” It was mistyped or copied with a missing character. Paste it again; if it still fails, create a new one
“That enrolment token has expired.” or “… has been revoked.” Create a new print agent token
“That enrolment token has already been used its full number of times.” Every machine it allowed has enrolled. Create a new token, with a higher Number of machines if you are setting up several
“That enrolment token is for encoder agents only.” It was made with the wrong Agent type. Create one with Print agent only
“That enrolment token belongs to a different organisation than the code you entered.” The organisation code you typed is not the one the token was made for. Copy the code from Settings → General in the same organisation the token was made in
The installation is finished Revoke the token, or leave it to expire. Revoking a token never affects an agent that has already enrolled

Enrolment tokens covers tokens for every kind of agent, and managing them over time.

In the portal, go to Settings → Downloads and download the print agent. It is a single file with nothing else to install. Put it in a folder of its own:

Terminal window
mkdir C:\idportal-agent; cd C:\idportal-agent

Check the file against the SHA-256 shown on the Downloads page:

Terminal window
(Get-FileHash .\idportal-agent.exe -Algorithm SHA256).Hash.ToLower()

If the two match, unblock the file so Windows lets it run:

Terminal window
Unblock-File .\idportal-agent.exe

The agent is not yet code-signed, so Windows may object. Only carry on if the checksum matched:

  • The browser blocks the download. Open the browser’s downloads list and choose Keep. Or copy the file across from another PC.
  • “Windows protected your PC” when it first runs. Choose More info → Run anyway. Unblock-File, above, prevents this.
  • Defender or other antivirus removes the file. In Windows Security → Protection history, restore and allow it. On a managed PC, ask your IT department to allow that exact file by its SHA-256. Do not turn protection off.
Terminal window
.\idportal-agent.exe enrol

It asks a few questions and finds your printers:

CardOffice print agent setup
Portal address [https://app.cardoffice.nz]:
Enrolment token: ••••••••••••
A name for this machine [PRINTROOM-01 print room]: Main print room
Organisation code (in the portal: Settings → General, e.g. acme-polytechnic): acme-polytechnic
Looking for printers…
1. Microsoft Print to PDF
2. ZXP Series 7
3. HP LaserJet M404
Which one is the card printer? (number) [2]:
A label for this printer [ZXP Series 7]:
Checking the printer…
ZXP Series 7: online, Ready
Registering with the portal…
Verifying the connection…
Setup complete.

On a ZXP7, choose the USB Card Printer driver entry, not the Singlesided one, which cannot print both sides. For another printer, choose the queue that prints both sides if your cards have a printed back.

After enrolling, open the printer’s page under Production and tick What this printer can do (both sides, magnetic stripe, chip encoder, laminator). The agent cannot see what is fitted, so the portal asks. Once it is confirmed, CardOffice sends that printer only cards it can make. See Ready to produce and the print queue.

The settings are saved to C:\Users\<you>\.idportal-agent\config.json.

That file holds the agent’s credential. Anyone who has it can take print jobs, which contain names and photos. Keep the folder readable only by the account the agent runs as.

Run the agent once from a console to confirm the enrolment and the printer:

Terminal window
.\idportal-agent.exe
09:14:02 INFO print agent starting {"printers":["ZXP_Series_7"]}

To test without using cards, set "dryRun": true in config.json. The agent then does everything except print, and keeps the artwork in its spool folder so you can inspect it. To produce a test job:

  1. Make sure a cardholder has an approved photo.
  2. Create an order for them and submit it.
  3. In Print runs, create a run with that order and release it.
  4. The agent picks up the job within seconds.

Set "dryRun": false, or remove it, when you are ready to print for real.

Check the agent at any time without printing:

Terminal window
.\idportal-agent.exe status

Then stop the console and set the agent to run on its own, in the next step. A console window can be closed by anyone, and closing it stops printing.

Run the agent as a scheduled task, so it starts with the PC, runs without a window, and restarts if it stops. In an administrator PowerShell, adjusting the path if needed:

Terminal window
# Change $Exe if the agent lives somewhere else.
$Exe = "C:\idportal-agent\idportal-agent.exe"
$LogDir = "C:\idportal-agent\logs"
New-Item -ItemType Directory -Force $LogDir | Out-Null
# A small wrapper so the agent's output goes to a log file you can read later.
$Wrapper = "C:\idportal-agent\run-agent.cmd"
@"
@echo off
"$Exe" >> "$LogDir\agent.log" 2>&1
"@ | Set-Content -Encoding ascii $Wrapper
$Action = New-ScheduledTaskAction -Execute "cmd.exe" -Argument "/c $Wrapper"
$Trigger = New-ScheduledTaskTrigger -AtStartup
$Principal = New-ScheduledTaskPrincipal -UserId "$env:USERDOMAIN\$env:USERNAME" `
-LogonType S4U -RunLevel Limited
$Settings = New-ScheduledTaskSettingsSet -RestartCount 999 `
-RestartInterval (New-TimeSpan -Minutes 1) `
-ExecutionTimeLimit ([TimeSpan]::Zero) -StartWhenAvailable
Register-ScheduledTask -TaskName "CardOffice print agent" `
-Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings
Start-ScheduledTask -TaskName "CardOffice print agent"
  • Run it as the account that installed the printer, not as SYSTEM, which often cannot see the printer.
  • -LogonType S4U runs it without a window and stores no password. -RestartCount 999 brings it back if it stops. Keep both.
  • The wrapper writes everything the agent prints to C:\idportal-agent\logs\agent.log, which is what to send with a support request.

To check on the task, restart it, or remove it:

Terminal window
Get-ScheduledTask -TaskName "CardOffice print agent" | Get-ScheduledTaskInfo
Get-Content C:\idportal-agent\logs\agent.log -Tail 50
Stop-ScheduledTask -TaskName "CardOffice print agent"; Start-ScheduledTask -TaskName "CardOffice print agent"
Unregister-ScheduledTask -TaskName "CardOffice print agent" -Confirm:$false

The same script is on the portal’s Documentation, Print agent setup page.

The agent hands each card to the printer’s Windows driver as a card-sized page, so most card printers with a Windows driver can print CardOffice cards. That includes printers from Evolis, Magicard, HID Fargo, Entrust (Datacard) and Matica. CardOffice tests with the Zebra ZXP Series 7. If you are choosing a printer, talk to us first.

What works with any printer, and what is ZXP7 only

Section titled “What works with any printer, and what is ZXP7 only”
ZXP Series 7 Other card printers
Printing, one or both sides Yes Yes, through the driver
Edge-to-edge printing Yes Yes, if the driver allows printing to the edge
Online, offline and error status Yes Yes, as Windows reports it
Clearing Windows’ stuck “offline” flag Yes Yes
Ribbon level, card count and serial number read from the printer Networked ZXP7s No. Keep counts up to date in Consumables
Cleaning reminders From the printer, and by card count By card count
Magnetic stripe encoding Yes No. Turn encoding off in the card design, or talk to us
Smart card or contactless encoding No No
  1. Install the manufacturer’s Windows driver and print a test card from Windows. Use the driver from the manufacturer’s website rather than one Windows finds by itself.
  2. Set the driver’s printing preferences (in Windows Settings, open the printer, then Printing preferences):
    • Card size: CR-80 (85.6 × 53.98 mm), sometimes called ID-1 or CR80.
    • Orientation: landscape, to match your card design.
    • Colour correction or colour matching: off, or “none”. The artwork is already colour-managed.
    • Printing to the edge: turn on any edge-to-edge, full-bleed or borderless option, and set any printable-area or margin adjustment to zero.
    • Both sides: turn on double-sided printing if your design has a printed back, and set the ribbon type to one that can print a back.
    • Ribbon type: match the ribbon fitted.
  3. Enrol the agent as in step 2, and choose that printer from the list. Give it a label you will recognise.
  4. Test with dryRun, then with a real card, as in step 3. Check:
    • the card is not scaled down and has no white border
    • the photo and text sit where the design puts them
    • the back prints the right way up
    • skin tones look natural
  5. Record the ribbon in Consumables, choosing the closest ribbon type, and correct the count when you fit a new one. CardOffice counts ribbon use from the cards it prints, but it cannot read the level from these printers.

If cards come out scaled or with a border, the driver is still fitting the page to its printable area: look again for edge-to-edge and margin settings. If a printer cannot print to the edge, design cards with a plain border, or talk to us.

Set these in the ZXP7 driver’s printing preferences. The agent uses the driver’s saved settings, so setting them once fixes every job.

Setting Value Why
Card size CR-80 (85.6 × 53.98 mm) The artwork is made to exactly this size
Orientation Landscape Matches the standard card designs
Resolution 300 dpi The ZXP7’s native resolution
Colour correction Off The artwork is already colour-managed. Correction on top turns skin tones orange
Print both sides On, if your design has a printed back
Ribbon type Match the fitted ribbon
Rotate front or back 180° As your card stock needs
Ribbon Images per roll Good for
YMCKO 750 Colour front, blank or pre-printed back
YMCKOK 500 Colour front, black text or barcode on the back
YMCUvK 750 Colour with a UV security panel
K (monochrome) 5000 Text-only cards, or pre-printed stock
KdO 1500 Monochrome with a protective overlay

These are the manufacturer’s figures and CardOffice uses them as starting counts. If your box says otherwise, correct the count in Consumables.

A double-sided card uses two images on a YMCKO ribbon and one on YMCKOK. CardOffice counts this correctly for the ribbon you have fitted.

A ZXP7 on the network answers questions about itself over SNMP, and the agent asks every few minutes. The printer’s page in the portal then shows what the printer said, not what the portal guessed:

Reading Where it shows Notes
Ribbon type and panels left Status, ribbon bar Read from the fitted ribbon
Serial number and firmware Printer card
Cards printed over the printer’s life Printer card The printer’s own counter
Cards in the hopper Printer card Only when the firmware counts cards; most report “at least one”, which shows as a dash
Alerts, in the printer’s words Status For example CLEAN PRINTER or RIBBON LOW
Last reading Printer card When the printer last answered

A USB printer cannot do this. Its page shows the spooler’s view only, and the counts stay as somebody last typed them.

Cards since cleaning is still counted by the portal from the cards it has sent, and reset with Record cleaning. The printer’s own cleaning reminder arrives as an alert.

For this to work:

  1. The printer must have an IP address that the print PC can reach, and the Windows queue must point at it (the Zebra network port or a standard TCP/IP port). The agent reads the address from the port.
  2. SNMP must be enabled on the printer with the community name public. The ZXP7 has this on from the factory; check it on the printer’s own web page under its network settings if readings never arrive.
  3. Nothing between the PC and the printer may block UDP port 161.

If the agent knows the address but gets no answer, the printer’s status line in the portal says No SNMP reply from the address, and the Printer card says what to check. To see exactly what the printer answers, run this on the print PC and send the output to support:

Terminal window
idportal-agent.exe printer-snmp "ZXP Series 7"

Use your own queue name in place of ZXP Series 7.

The Consumables list on the same page is different: it is the boxed ribbons, cards and cleaning kits on your shelf, which only you can count. Record them there so the portal can warn you before you run out.

Magnetic stripe encoding through the agent is available on the ZXP Series 7. If your card design includes a magnetic stripe, the agent sends the track data with the print job, using Zebra’s encoding utility. Tell the agent where it is installed:

Terminal window
[Environment]::SetEnvironmentVariable("ZEBRA_ENCODER_PATH", "C:\Program Files\Zebra\encoder.exe", "Machine")

If a card needs encoding and the utility is missing, the job fails rather than printing a card without its stripe.

Track limits follow ISO 7811: track 1 up to 76 characters, tracks 2 and 3 numbers only, up to 37 and 104 digits.

Card printers go into standby by themselves. When the ZXP7 does, Windows marks the print queue offline and does not clear the mark when the printer wakes. Other printers can do the same. The agent clears the mark for you.

The printer’s page in the portal has a Wake mode setting:

Let it sleep between cards (default) Keep it awake
While idle The printer sleeps, and shows as Standby, asleep until the next card Kept ready
The first card after a quiet spell Takes a few seconds longer Prints at once
An unplugged printer Shows as standby until a card fails Shows as offline within a minute

Choose Keep it awake where somebody needs to see straight away that a printer has been unplugged.

C:\Users\<you>\.idportal-agent\config.json:

Key Default Meaning
serverUrl Your portal address
agentToken Issued at enrolment. Treat it as a password
agentName The PC’s name Shown in the portal
printers[].queueName The Windows print queue name
printers[].displayName The label shown in the portal
pollIntervalSeconds 5 How often to check for work when idle
heartbeatIntervalSeconds 60 How often to report status
proactiveWake false Keep the printer awake. The portal’s Wake mode overrides this
spoolDirectory .idportal-agent\spool Where artwork is kept while printing
keepArtworkHours 48 How long artwork stays in the spool folder
logLevel info Set debug when diagnosing a problem
dryRun false Do everything except print

The spool folder holds card artwork, which shows people’s names and photos. Keep keepArtworkHours no longer than you need.

Situation What happens
CardOffice unreachable The agent keeps retrying. Printing resumes by itself
Printer offline The job is reported failed and queued again
Out of cards or ribbon, or a card jam The job stops and the operator is told. Someone has to open the printer
Encoding failed The job fails. No card is produced without its stripe
The agent stops partway through a card The job goes back in the queue after a few minutes
The agent stops checking in It shows as offline within a few minutes, and administrators are emailed

This section is for the IT team preparing a print PC that is managed by Group Policy, Intune, AppLocker or a corporate firewall.

The agent needs Detail
Outbound HTTPS (TCP 443) to your portal address app.cardoffice.nz, or your own address if you host CardOffice yourself. Nothing inbound
Outbound HTTPS to CardOffice’s storage address Card artwork is downloaded from a short-lived link at a separate address. If your firewall allows only listed destinations, ask support for it
A direct connection The agent does not use the Windows proxy settings. Allow the print PC to reach both addresses without a proxy
No TLS inspection The agent checks certificates against its own list of public certificate authorities, not the Windows certificate store, so it does not trust a certificate your organisation installs for inspection. Exempt both addresses. Print jobs carry names and photos, so they should not be decrypted on the way anyway
Windows PowerShell in Full Language mode The agent uses powershell.exe to read printer status and to print
An account that can print to the card printer The scheduled task runs as this account. See step 4
Write access to C:\Users\<account>\.idportal-agent Its configuration and spool folder

A browser on the same PC is not a fair test of the network. Browsers use the proxy and trust your inspection certificate; the agent does neither. Test with idportal-agent status instead.

Symptom Cause Fix
status shows Portal connection: FAILED — fetch failed The agent cannot reach CardOffice: a firewall rule, a network that allows web traffic only through a proxy, TLS inspection, or a PC clock that is far out Allow direct outbound HTTPS to both addresses, without a proxy or inspection. Turn on automatic time
status connects, but jobs fail with fetch failed or Artwork download failed The storage address is blocked Allow the storage address
Task Scheduler shows the last run result 0x80070569 A task that runs without a window needs the account to hold Log on as a batch job, and Group Policy has removed it Grant the account that right under User Rights Assignment, or ask for a policy exception for this account
The agent works from a console, but as a task the printer shows offline or Access is denied The printer is shared from a print server (\\server\printer). A task that runs without a window has no network credentials, so it cannot use a shared printer Install the printer on the print PC itself, by USB or a direct TCP/IP port
Every job fails with a message that mentions language mode PowerShell runs in Constrained Language mode, usually because of AppLocker or Windows Defender Application Control. Printing needs Full Language mode Exclude the print PC, or the agent’s account, from the policy that enforces Constrained Language mode
The download is blocked, or antivirus removes the agent The agent is not yet code-signed Allow that exact file by its SHA-256. See step 1

The agent writes its log to the console. Installed as described in section 4, the wrapper keeps that output in C:\idportal-agent\logs\agent.log; a task made without the wrapper keeps no log. To diagnose a problem, read the last lines of that file, use idportal-agent status, the printer’s page in the portal and Print queue, or stop the task and run the agent in a console with "logLevel": "debug" in config.json. Start the task again afterwards.

“No agent configuration found.” Run idportal-agent enrol.

“That agent token is not recognised.” The agent was removed in the portal. Enrol again with a new enrolment token.

“This agent has been deactivated.” Someone switched it off on the printer’s page in the portal. Switch it back on there.

Nothing prints and there are no errors. Run idportal-agent status. If it is connected and the printer is online, check Print queue: nothing may be queued, or the cards may still be being prepared.

The colours are wrong. Turn off colour correction in the driver.

Cards are scaled or off-centre. Set the card size to CR-80 and turn off any fit-to-page option. The artwork already includes bleed.

Only the front prints. The driver is set to single-sided, or a YMCKO ribbon is fitted for a design that needs a printed back.

The printer’s page shows no serial number, ribbon or readings. Only a networked printer reports these. See Printer readings over the network for what to check, and run idportal-agent.exe printer-snmp on the print PC to see what the printer answers.

“Access is denied” on Windows. The agent is running as an account that cannot see the printer. Run it as the account that installed the printer.

© 2026 Secure ID Ltd. All rights reserved.Documentation licence and terms