diff --git a/package.json b/package.json index 44aa908..4953653 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fieldlens/print", - "version": "0.1.22", + "version": "0.1.23", "private": true, "type": "module", "scripts": { diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 83b3919..63b64cb 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fieldlens-print" -version = "0.1.22" +version = "0.1.23" description = "FieldLens print-stream barcode capture companion" authors = ["Arrowstack"] edition = "2021" diff --git a/src-tauri/src/printers.rs b/src-tauri/src/printers.rs index 01fb1f1..751d30c 100644 --- a/src-tauri/src/printers.rs +++ b/src-tauri/src/printers.rs @@ -373,12 +373,21 @@ if (-not (Get-PrinterPort -Name $portName -ErrorAction SilentlyContinue)) {{ Add-PrinterPort -Name $portName -PrinterHostAddress '127.0.0.1' -PortNumber 9100 }} +$targetConfig = Get-PrintConfiguration -PrinterName $TargetPrinter -ErrorAction SilentlyContinue $existing = Get-Printer -Name $queueName -ErrorAction SilentlyContinue if ($existing) {{ Set-Printer -Name $queueName -DriverName $target.DriverName -PortName $portName }} else {{ Add-Printer -Name $queueName -DriverName $target.DriverName -PortName $portName }} + +# The virtual queue uses the same driver as the physical destination, so its +# PrintTicket can be copied safely. This keeps paper size, duplex settings and +# especially orientation aligned with the real printer instead of falling back +# to the driver's portrait default. +if ($null -ne $targetConfig -and $targetConfig.PrintTicketXML) {{ + Set-PrintConfiguration -PrinterName $queueName -PrintTicketXml $targetConfig.PrintTicketXML +}} "#, port = WINDOWS_PORT_NAME, queue = VIRTUAL_PRINTER_NAME, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 43ace6f..379f24f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "FieldLens Print", - "version": "0.1.22", + "version": "0.1.23", "identifier": "dev.arrowstack.fieldlens.print", "build": { "beforeDevCommand": "npm run dev", diff --git a/src/main.ts b/src/main.ts index 7ef4aa0..93ecec6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -142,7 +142,7 @@ let config: AppConfig let jobs: Job[] = [] let status: Status = { running: false, mode: 'raw-proxy', pending: 0, jobs: 0 } let loginTimer: number | undefined -let currentVersion = '0.1.22' +let currentVersion = '0.1.23' let bundleType: BundleType | null = null let availableUpdate: Update | null = null let availableManualUpdate: ManualUpdate | null = null