HPDFCreateXPSDocumentHandler Function
function HPDFCreateXPSDocumentHandler: IHPDFDocumentHandler;
Creates the optional XPS and OpenXPS fixed-page handler with ordered Glyphs text and native vector Path conversion
The path importer accepts bounded abbreviated geometry, F0 and F1 fill rules, attribute or property-element solid ARGB and RGB fills and strokes, property-element multi-stop LinearGradientBrush and elliptical RadialGradientBrush values, uniform stop alpha, brush and path opacity, relative-to-bounds and absolute gradient mapping, stroke width, and six-parameter RenderTransform values
Package JPEG, PNG, TIFF, and JPEG XR ImageBrush fills support None, Tile, FlipX, FlipY, and FlipXY tile modes, absolute or RelativeToBoundingBox Viewbox and Viewport mapping, native path and placement clipping, finite six-parameter Transform attributes or ImageBrush.Transform MatrixTransform elements in brush-local coordinates, brush and path opacity, PNG soft-mask alpha, DPI-aware intrinsic sizing, and one decoded-resource cache per conversion
Repeated image brushes use native PDF image tiling patterns with one, two, or four clipped placements for ordinary or reflected cells, while one image XObject and its soft mask remain shared; pattern matrices concatenate fixed-page, path, and brush transforms without changing the vector path geometry
Path.OpacityMask accepts solid, multi-stop linear or elliptical radial gradient, and PNG ImageBrush masks with ordinary, tiled, or reflected placement; uniform alpha is folded into existing fill and stroke states, while variable alpha uses bounded native DeviceGray transparency groups that reuse shading patterns and image soft-mask streams
VisualBrush accepts inline or resource-backed Canvas, Path, and Glyphs visuals, resolves StaticResource values through nested and remote ResourceDictionary scopes, and maps an absolute Viewbox into an absolute or RelativeToBoundingBox Viewport
Each distinct visual is compiled once into a reusable PDF Form XObject with its required font, XObject, pattern, graphics-state, and color-space resources; ordinary placement executes the Form directly, while Tile, FlipX, FlipY, and FlipXY use bounded native tiling patterns instead of expanding visual drawing commands per cell
Visual, brush, and containing-path transforms and opacity compose in their own coordinate spaces, while recursive resources, malformed mappings, unsupported nested content, and exceeded depth, content, cache, or placement budgets fail closed before a partial Form is published
Canvas.Clip accepts abbreviated geometry, local or remote StaticResource PathGeometry values, and direct property elements containing bounded structured PathFigure line, polyline, Bézier, quadratic, or arc segments; geometry transforms and EvenOdd or NonZero fill rules compose with the Canvas transform before native PDF W* or W clipping
Nested Canvas clips retain their PDF graphics-state intersection, constrain descendant link annotations to active transformed clip bounds, treat empty geometry as an empty clip without a diagnostic, cap parsed geometry at 100,000 numeric values, and fail closed before child painting when geometry or its effective matrix is malformed or singular
Canvas Opacity and solid, linear-gradient, radial-gradient, or PNG image Canvas.OpacityMask values capture descendants into one isolated DeviceRGB Form XObject so overlapping children are composited before the group alpha is applied; uniform mask alpha is folded into that group state while spatially variable alpha reuses bounded native soft-mask resources
Nested Canvas groups preserve their own transforms, clips, transferred font, XObject, pattern, graphics-state, and color-space resources, and clipped links; conversion permits at most 4,096 Canvas group Forms and 16 MiB of captured commands per group, and rejects duplicate, unsupported, malformed, singular, or oversized masks before publishing partial or unreachable resources
Glyphs parses at most 65,536 strict Indices mappings, preserves cluster code-unit and glyph counts, explicit hundredths-of-em advances, horizontal and vertical offsets, odd BidiLevel reverse progression, solid attribute or Glyphs.Fill property brushes, opacity, and Unicode extraction, batches simple mappings into native PDF TJ arrays, and fails closed on malformed or unbounded input
Package FontUri resources accept TrueType and OpenType programs, TTC member fragments, and GUID-obfuscated XPS fonts, preserve direct GlyphIndex values or cmap-derived glyphs, reuse font bytes across runs, honor embedding and no-subsetting permissions, and publish cluster-aware ToUnicode maps
FixedPage.NavigateUri on transformed Path and Glyphs visuals creates native PDF link annotations whose click bounds follow path geometry or glyph metrics; HTTP, HTTPS, and mail links become URI actions, while package-relative page references and percent-decoded LinkTarget fragments become forward or backward GoTo actions after all pages are created
A Canvas FixedPage.NavigateUri is inherited by descendant Path, Glyphs, and nested Canvas visuals until a descendant overrides it; each annotation retains its visual's bounds and transform, active Canvas clips constrain inherited click regions, nested scopes restore the outer target, isolated opacity groups preserve annotations, and reusable VisualBrush capture remains non-interactive
Navigation accepts at most 65,536 links and 8,192 characters per URI, checks cancellation while publishing, suppresses annotations while reusable VisualBrush content is captured, and fails closed for control characters, unsafe schemes, missing targets, or page and fragment mismatches
Unsupported non-standard RelativeTransform, unresolved matrix resources, Repeat or Reflect gradient spread, non-sRGB interpolation, variable stop alpha in paint brushes, degenerate axes, color conversion, image strokes, relative VisualBrush viewboxes, style simulation, sideways glyphs, and advanced stroke properties remain explicit diagnostics