---
title: PdfServiceProxy
summary: API reference for PdfServiceProxy.
status: draft
owner: SAIF.Core Documentation Team
last_reviewed: 2026-09-24
library: SAIF.Services.Web.Proxies
reference_type: package
---

# PdfServiceProxy

`PdfServiceProxy` hides the internal generated `PDFServiceClient` (WCF) behind a single `GetImage` operation, requesting an immediate-priority cache entry and delegating the wait/retry behavior to the remote PDF service via `PDFCacheArgs` rather than implementing client-side retries itself. It has no in-repository caller and is reachable only by package consumers*.

## Purpose
- Retrieve a cached PDF page image by sequence number, waiting for the remote service to render and cache it if it is not yet available ([OP-WP-05](../../operations/retrieve-a-cached-pdf-image.md), [WP-BR-011](../../business-rules.md#wp-br-011-pdf-image-retrieval-requests-immediate-caching-with-retry)).

## Context
- Namespace: `SAIF.Services.Web.Proxies`
- Assembly/package: `SAIF.Services.Web.Proxies` (packaged in `SAIF.SAIFCode.Core`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Constructor | `PdfServiceProxy(string serviceUrl, string database)` | Guards both arguments, then builds a `BasicHttpBinding` with `int.MaxValue` quotas; `database` is stored as the data environment for later requests ([WP-BR-001](../../business-rules.md#wp-br-001-required-arguments-must-be-non-null-or-non-empty)) |
| `GetImage` | `byte[] GetImage(long imageSeqNum, int maxWaitTimeInSeconds = 10)` | Requests immediate caching (priority 10000) under data user `"IMG"`, retrying up to `maxWaitTimeInSeconds` times at 1-second intervals, and returns the cached image bytes ([WP-BR-011](../../business-rules.md#wp-br-011-pdf-image-retrieval-requests-immediate-caching-with-retry)) |
| `Dispose` | `void Dispose()` | Closes the underlying generated `PDFServiceClient` by calling `Close()`, without an `Abort()` fallback on a faulted channel* |

## Behavioral notes
- A null `result` returned by the wire `LoadCache` call throws `NullReferenceException`; there is no null guard on the wire response.
- `"IMG"` is a fixed data-user pool code, not a database schema.

## Constraints and usage notes
- Callers must supply both the endpoint URL and the target data environment/database at construction; neither is read from configuration by this wrapper.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `Services/SAIF.Services.Web.Proxies/PDFServiceProxy.cs`
