Preview a document¶
Renders a document from a package name and xPression data XML through the xPression Design web service, returning the rendered bytes for preview purposes without printing or distributing the result.
| Field | Value |
|---|---|
| Operation ID | OP-01 |
| Trigger | clsPrint.previewDocument invoked (two public overloads: (inPackage, inXML) or (inPackage, inXML, inOutputProfile)) |
| Inputs | Package name, xPression data XML, optional output profile (defaults to "PDF" when not supplied) |
| Outputs | Rendered document bytes (Byte()) |
| Primary components | clsPrint.previewDocument (public overloads), private previewDocument(), m_Xpresso.previewDocument |
| Entry point | SAIF.Services.Printing/clsPrint.vb |
Steps¶
- The public 2-argument overload trims and assigns
inPackageto thePackageproperty. The package name is normalized by stripping a trailing.pkgextension via thePackagesetter (BR-PRT-001). - Assigns
inXMLto theXMLproperty unchanged — no transformation is applied. - The 3-argument overload additionally assigns
inOutputProfileto theOutputProfileproperty, overriding the"PDF"default that would otherwise apply. - Both public overloads delegate to the private parameterless
previewDocument(), which callsm_Xpresso.previewDocument(m_Package, m_XML, m_OutputProfile, m_Application)against the xPression Design web service. - The bytes returned by the web service are returned to the caller unchanged — there is no caching and no success/failure flag distinct from the returned bytes.
Process flow¶
flowchart TD
Start(["previewDocument invoked"]) --> Norm["Normalize package name"]
Norm --> SetXML["Set XML<br>(and OutputProfile<br>if 3-arg overload)"]
SetXML --> Call["Call m_Xpresso.<br>previewDocument<br>via xPression<br>Design service"]
Call --> End(["Return rendered bytes"])
Failure and edge-case behavior¶
- There is no try/catch around the web service call; a
SoapExceptionorWebExceptionraised bym_Xpresso.previewDocumentpropagates directly to the caller, unlike the non-throwing pattern used byReportBase(BR-PRT-010 describes that separate, non-throwing pattern; this operation does not use it). - The 2-argument overload does not set
OutputProfile— whichever value was last set on the instance (or the"PDF"default) is used silently, with no indication to the caller that an implicit value is in effect.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Configuration
- API reference
Sources¶
SAIF.Services.Printing/clsPrint.vb