Skip to content

[Feature]: OXPS #613

In progress
In progress

Description

@golranco-afk

What would you like Filee to do?

Could you please also create a converter for OXPS files and the other Windows-native printing file format, XPS?

Why / when would you use it?

tank you

Ideas for how it could work

tank you

Activity

  1. added
    enhancement
    on Oct 26, 2026
  2. KnifeLemon commented on Oct 26, 2026

    @KnifeLemon
    Owner

    Thanks for the request! Filee doesn't read XPS or OXPS yet. Both are page formats like PDF, so PDF (and pictures from it) would be the natural targets. I'll keep this open as a format request.

    Until then, Windows can do it: open the file in XPS Viewer (Settings → Apps → Optional features → add "XPS Viewer" if it's missing), then Print → Microsoft Print to PDF.

  3. cre8ive-marketing commented on Dec 1, 2026

    @cre8ive-marketing
    Collaborator

    @KnifeLemon I've assigned myself to this format request. Here's the plan; I'll start building once you OK it.

    Plan: XPS / OXPS → PDF (and pictures from it)

    • Own code, no new engine. XPS and OXPS are ZIP packages of XML pages (FixedDocumentSequence → FixedDocument → FixedPage).
      • Reading: with System.IO.Compression + XML, under the existing archive limits (ArchiveSafety).
      • Drawing: with PdfSharp, like Filee's other page formats.
    • Version 1 draws:
      • Path (geometry + solid / linear / radial brushes);
      • Glyphs (the embedded fonts, de-obfuscated as the spec says);
      • ImageBrush pictures (JPEG, PNG, TIFF);
      • Canvas transforms, clips and opacity.
    • Shown as a notice: what's unsupported (visual brushes, gradients with transforms) is drawn as its bounding box outline and named in a notice, never silently dropped.
    • Edges:
      • xps, oxps → pdf;
      • from the PDF on, PNG/JPG through the existing PDF routes.
    • Format rules: both are read-only document formats with a public spec (ECMA-388). A new format may need your OK under FORMAT-RULES.md.
    • No donut slot, no schema step.

    Tests

    • Test file: a small XPS generated in the test (ZIP + XML written by the test, no sample files). It has a path, coloured text with an embedded font, and a PNG.
    • Checks: the PDF has one page of the right size, and the text can be extracted. OXPS gives the same result.
  4. KnifeLemon commented on Dec 2, 2026

    @KnifeLemon
    Owner

    @cre8ive-marketing OK, go ahead on main, as a self-contained reader. As with the others: a few at a time is fine, and an open PR counts as in progress.

    • FORMAT-RULES: no extra OK needed. A read-only input passes rule 5 ("almost always"). Give xps/oxps fields and a grade in FormatFields.cs (FormatFieldsTests fails without them), and add both to SharedPresetVersions.Formats as "2.6.0".
    • Draw with SkiaSharp, not PDFsharp. Filee doesn't draw text with PDFsharp anywhere: nothing uses XFont, and there's no font resolver, which PDFsharp would need for the XPS's embedded fonts. The page formats Filee draws (CadRenderer, SvgRenderer, GcodeDrawing) write their PDFs with SKDocument.CreatePdf. That also covers gradients, clips and opacity. Glyphs can be drawn by glyph id (Indices) from an SKTypeface loaded from the de-obfuscated font. (PDFsharp stays at 6.2.4 either way.)
    • Package: ArchiveSafety is for unpacking archives into a folder (zip slip, links, free space). The closer model is Ofd/OfdPackage.cs, since OFD is also ZIP + XML pages: parts are looked up by name, references stay inside the package, DTDs are off, and size limits per part and in total are checked while decompressing. Reuse or mirror it.
    • Pictures: XPS also allows JPEG XR (.wdp). Skia reads JPEG and PNG, and Magick.NET reads TIFF. JPEG XR can get the outline-and-notice treatment.
    • Test font: take one from tests/Filee.Engines.Tests/Fonts/ and obfuscate it in the test. No new font file.
    • New notice strings go in all 23 i18n files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions