# salmanasmat/windows-airprint-bridge architecture

> Architecture diagram of the GitHub repository salmanasmat/windows-airprint-bridge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/salmanasmat/windows-airprint-bridge
- Repository: https://github.com/salmanasmat/windows-airprint-bridge

## Overview

Windows AirPrint Bridge shares a Windows printer over the local network: mobile devices discover it through mDNS, send IPP print requests over HTTP, and receive jobs rendered and printed by the bridge. Its single main script implements discovery, protocol handling, job processing, and Windows printer access. The README documents PDF rendering, paper sizing, copies, page ordering, and rotation. Source excerpts show parts of those implementations but omit much of the main script; links based on documented behavior cite the README. The response decoder is a separate diagnostic client, not part of the runtime workflow.

Main entry points: [`airprint_bridge.py`](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py) (IPP request handler), [`decode_ipp.py`](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/decode_ipp.py) (IPP response decoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_network["Network access"]
  node_discovery["mDNS discovery<br/>[airprint_bridge.py]"]
  node_http["HTTP transport<br/>[airprint_bridge.py]"]
end

subgraph group_protocol["IPP protocol"]
  node_ipp_handler["IPP request handler<br/>[airprint_bridge.py]"]
  node_ipp_attributes["IPP attributes<br/>[airprint_bridge.py]"]
  node_ipp_responses["IPP responses<br/>[airprint_bridge.py]"]
end

subgraph group_printing["Print processing"]
  node_job_options["Job options<br/>[airprint_bridge.py]"]
  node_pdf_rendering["PDF rendering<br/>[airprint_bridge.py]"]
  node_urf_handling["URF handling<br/>[airprint_bridge.py]"]
  node_page_layout["Page layout<br/>[airprint_bridge.py]"]
  node_job_copies["Copy and order<br/>[airprint_bridge.py]"]
end

subgraph group_operations["Printer operations"]
  node_config["Job configuration<br/>[airprint_bridge.py]"]
  node_windows_printer[("Windows printer")]
  node_service["Bridge service<br/>[airprint_bridge.py]"]
  node_response_decoder["IPP response decoder<br/>[decode_ipp.py]"]
end

node_mobile(("Mobile print client"))

node_mobile -->|"discovers printer"| node_discovery
node_mobile -->|"sends print job"| node_http
node_service -->|"advertises services"| node_discovery
node_service -->|"binds IPP port"| node_http
node_http -->|"routes requests"| node_ipp_handler
node_ipp_handler -->|"parses attributes"| node_ipp_attributes
node_ipp_handler -->|"sends responses"| node_ipp_responses
node_ipp_handler -->|"extracts job options"| node_job_options
node_ipp_handler -->|"renders documents"| node_pdf_rendering
node_ipp_handler -->|"handles URF jobs"| node_urf_handling
node_ipp_handler -->|"sets paper layout"| node_page_layout
node_ipp_handler -->|"applies job settings"| node_job_copies
node_job_options -->|"reads settings"| node_config
node_pdf_rendering -->|"prints pages"| node_windows_printer
node_page_layout -->|"sets printer mode"| node_windows_printer
node_job_copies -->|"submits copies"| node_windows_printer
node_response_decoder -->|"probes endpoint"| node_http
node_response_decoder -->|"decodes IPP data"| node_ipp_responses

click node_discovery "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_http "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_ipp_handler "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_ipp_attributes "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_ipp_responses "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_job_options "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_pdf_rendering "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_urf_handling "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_page_layout "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_job_copies "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_config "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_service "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py"
click node_response_decoder "https://github.com/salmanasmat/windows-airprint-bridge/blob/main/decode_ipp.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_discovery,node_http,node_mobile toneBlue
class node_ipp_handler,node_ipp_attributes,node_ipp_responses toneAmber
class node_job_options,node_pdf_rendering,node_urf_handling,node_page_layout,node_job_copies toneMint
class node_config,node_windows_printer,node_service,node_response_decoder toneRose
```

## Components

### Network access

- [mDNS discovery](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [HTTP transport](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`

### IPP protocol

- [IPP request handler](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [IPP attributes](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [IPP responses](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`

### Print processing

- [Job options](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [PDF rendering](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [URF handling](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [Page layout](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [Copy and order](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`

### Printer operations

- [Job configuration](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- **Windows printer**
- [Bridge service](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/airprint_bridge.py): `airprint_bridge.py`
- [IPP response decoder](https://github.com/salmanasmat/windows-airprint-bridge/blob/main/decode_ipp.py): `decode_ipp.py`

### Other components

- **Mobile print client**

## Connections

- Mobile print client → mDNS discovery: discovers printer (evidence: `README.md`)
- Mobile print client → HTTP transport: sends print job (evidence: `README.md`)
- Bridge service → mDNS discovery: advertises services (evidence: `README.md`)
- Bridge service → HTTP transport: binds IPP port (evidence: `README.md`)
- HTTP transport → IPP request handler: routes requests (evidence: `README.md`)
- IPP request handler → IPP attributes: parses attributes (evidence: `airprint_bridge.py`)
- IPP request handler → IPP responses: sends responses (evidence: `airprint_bridge.py`)
- IPP request handler → Job options: extracts job options (evidence: `airprint_bridge.py`)
- IPP request handler → PDF rendering: renders documents (evidence: `README.md`)
- IPP request handler → URF handling: handles URF jobs (evidence: `README.md`)
- IPP request handler → Page layout: sets paper layout (evidence: `README.md`)
- IPP request handler → Copy and order: applies job settings (evidence: `README.md`)
- Job options → Job configuration: reads settings (evidence: `airprint_bridge.py`)
- PDF rendering → Windows printer: prints pages (evidence: `README.md`)
- Page layout → Windows printer: sets printer mode (evidence: `airprint_bridge.py`)
- Copy and order → Windows printer: submits copies (evidence: `README.md`)
- IPP response decoder → HTTP transport: probes endpoint (evidence: `decode_ipp.py`)
- IPP response decoder → IPP responses: decodes IPP data (evidence: `decode_ipp.py`)
