Skip to content

Built-in engines W26: PDF to editable slides, mind maps, chart templates and ODF charts, PDF stream limits - #1712

Merged
KnifeLemon merged 15 commits into
builtin-enginesfrom
p4/w26
Nov 19, 2026
Merged

KnifeLemon merged 15 commits into
builtin-enginesfrom
p4/w26

Conversation

@KnifeLemon

Copy link
Copy Markdown
Owner

Wave 26 of the built-in engines: PDF → PPTX with editable text, mind maps, chart follow-ups, and a security/test round.

PDF → PPTX with editable text (#1150)

  • Each page becomes a slide of the page's size, built from the existing PDF reader (no second parser).
    • Text: one text box per paragraph, with font, size, colour, bold/italic, links, alignment, indents and line spacing.
    • Ruled tables become PowerPoint tables (merged cells, borders, shading).
    • Pictures become picture shapes; upright rectangles and straight lines become shapes; a page-filling rectangle becomes the background.
    • Curves, polygons and pages with more than 1,000 simple shapes go into one transparent Skia picture.
    • Line widths follow the page's scaling (PdfPig reports them unscaled).
  • Editable slides are the default for every PDF → PPTX preset. The old picture deck stays behind the new preset option "Pictures of the pages" (PdfOptions.SlidePictures, presets.slide_pictures* in 23 locales).
  • Limits: 20,000 pages, the document object budget, 500,000 path segments drawn per page; cancellation between pages and paths.

Mind maps (#1543, #1004)

  • FreeMind / Freeplane .mm and XMind .xmind (content.json and XMind 8 content.xml) read as an outline: headings for the first levels, nested lists below, notes, labels, links (including links between topics), markers as symbols, XMind pictures, one page per sheet.
  • Password-protected XMind files are refused with error.xmind_password. A .mm that isn't XML (Objective-C++) is read as text.
  • Trees are walked with an explicit stack; content.json nesting is checked before parsing; existing XML and package limits apply.
  • Settings schema v108: the documents donut learns .mm and .xmind.

Charts

  • .crtx chart templates → PDF / SVG / PNG ([Format]: .crtx #1354), with Office's sample values when the template has none. Unsupported template types are refused with error.chart_template_unsupported. Settings schema v109: the vector donut learns .crtx.
  • XLSX chart sheets print as one page each (Workbook.ChartSheets).
  • ODF charts (OdfChartReader) drawn in ODT, ODP/ODG and ODS. The left-out notice counts undrawn ODF charts as charts (charts_pictured).
  • HWPX hp:chart drawn from its OOXML chart part, falling back to the OLE object.

Security and tests

  • PDF streams: PDFsharp's Flate, LZW and ASCII85 decoders are replaced (same output, checked byte for byte) with ones that stop at DocumentLimits.MaxPdfStreamBytes, and each PDFsharp open runs in a total budget. Relies on PDFsharp staying at 6.2.4; a test checks the swap.
  • Cancellation tokens passed to ImageReader.Read from HwpxWriter, PandocConverter and HideService; picture windows cancel the read when they close.
  • PDF nesting limit checked on a 256 KB thread stack (macOS secondary threads are 512 KB).
  • NsisReaderTests hides 7-Zip per test (AsyncLocal) instead of for the whole process.
  • Hardening while looking for the Linux SIGSEGV: an unallocated bitmap in WmfPlayer.Bitmap16, a temporary SKData that could be freed during SKTypeface.FromData, a racy lazy typeface. New DibStrideTests. The crash itself isn't reproduced; --blame-crash will name the test next time.

Merge notes

  • Settings schema is now 109 (v107 unused); both v108 and v109 migrations kept.
  • README rows, FormatFields and the General grade count (105) combined from the mind map and chart branches.

Tests

Run locally on the merged branch:

  • Release build
  • Filtered engine tests (PDF slides, mind maps, charts, PDF limits, Dib, NSIS/LZMA, HWPX, ODT, XPS, metafiles, fuzz): 573 passed, 13 skipped, 0 failed
  • Core: 1785 passed, 11 skipped
  • App localization, preset editor, settings and Hide window tests: 316 passed, 9 skipped
  • dotnet format --verify-no-changes --severity warn clean on Engines, Core and their tests

🤖 Generated with Claude Code

KnifeLemon and others added 15 commits November 20, 2026 05:04
A chart template is an OPC package around a DrawingML chart part. The
drawing engine now reads it (ChartTemplate, an IFixedPages document of
one page): the chart part from the package's chart template
relationship, else the content types, else chart/chart.xml; colours and
fonts from its theme override. Series without cached values get Office's
sample values and categories, and a plot without series gets sample
series, as Excel's template preview shows a template; 3D bar, line, area
and pie plots are drawn flat. Radar, bubble, stock, surface, bar-of-pie
and chartex templates are refused with error.chart_template_unsupported
(all locales).

.crtx is a read-only vector format (general grade, spreadsheet and
vector fields); settings v109 teaches existing vector donuts the
extension. The drawing engine's description names chart templates.

Reading stays within DocumentLimits and ChartReader's series and point
limits, and the chart is charged to a ChartBudget. Tests build the
templates in code; a fuzz target mutates whole templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The XLSX reader keeps visible chart sheets (Workbook.ChartSheets, for
the printer only, so the writers to other spreadsheet formats don't get
empty sheets): their page setup, header and footer, and the chart of
their drawing part. The sheet printer prints each in the workbook's
order as one page with the chart filling the margins.

The capability check names a chart sheet only when its chart isn't one
ChartReader draws or something is placed over the chart, so such
workbooks stay on the built-in printer. XLSB chart sheets are still
named. Chart sheets count against the workbook's ChartBudget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MindMapReader reads .mm (FreeMind / Freeplane XML) and .xmind (content.json
of XMind Zen and 2020+, content.xml of XMind 8) into the document model as
an outline: the central topic, main topics and subtopics are headings 1-3,
deeper topics nested bullet lists (nine levels at most). Notes and details
(HTML, plain text, Markdown) follow their topic, a list item's as its
continuation; attributes and labels as lines; priority, done, star and
arrow icons and markers as symbols; web links stay links and links to
other topics point at a bookmark on that topic. XMind topic pictures are
unpacked, each sheet starts a new page, and a file saved with a password
is refused with error.xmind_password (all locales). A .mm that isn't XML
(Objective-C++ source) is read as plain text.

Every document writer takes the maps (DOCX, ODT, HWPX, PDF through the
Filee renderer, slides); the markup engine writes them as Markdown, HTML,
TXT and OPML, where every topic is a heading so the whole tree is kept.
Both formats are read only, on the documents donut; settings v108 teaches
existing libraries the two extensions.

Input is bounded: SafeXml and DocumentPackage limits, JSON nesting checked
before parsing, both trees walked with an explicit stack, paragraphs and
pictures counted against DocumentLimits. Tests build the maps in code and
cover the outline, routes, conversions without Pandoc and hostile input;
a fuzz target mutates the XML, the packages and content.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each PDF page is rebuilt on its slide from the PDF reader PDF to DOCX uses:
paragraphs become text boxes at their place with the PDF's fonts, sizes,
colours, bold / italic and links; ruled tables become tables; pictures
become picture shapes; upright rectangles and straight lines become shapes
(a page-filling rectangle the background colour), and the remaining
drawing is one transparent picture drawn with Skia. Line widths follow the
transformation they were drawn under.

The picture slides stay as the preset option "Pictures of the pages"
(PdfOptions.SlidePictures). Pages, paragraphs, objects and drawn path
segments are bounded; tests build their PDFs in code, read the result with
the Open XML SDK and Filee's slide reader and renderer, and fuzz the
reading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenDocument charts: the new OdfChartReader reads an embedded chart
object (office:chart) into the chart model, its values from the chart's
own table (a range into a Calc sheet falls back to the series' column or
row of that table): bar, line, area, pie, doughnut and scatter plots,
combinations on a secondary axis, titles, axes, gridlines, legend, data
labels, fills and strokes of the chart, wall, series and points, and
text properties; LibreOffice's palette for series without a fill. 3D,
radar, bubble, stock, surface and Gantt charts are left out.

- ODT: a chart becomes a picture that carries the chart, so the renderer
  draws it as vectors and the writers get the picture. A chart it
  doesn't draw keeps its replacement picture and is counted as a chart
  (notice.renderer_left_out.charts_pictured, all locales), or as a chart
  left out without one, no longer as an embedded object. The renderer's
  check lets an ODT through when every object is a chart it draws.
- ODP / ODG: chart objects are drawn by the slide renderer.
- ODS: charts in frames anchored to a cell or the sheet are printed by
  the sheet printer; the capability check names only charts it doesn't
  draw (and still names other drawings).

HWPX: an hp:chart is drawn from the OOXML chart part its chartIDRef
names. The ooxmlchart case of an hp:switch is now taken, and a chart the
chart reader doesn't draw (or a missing or damaged part) falls back to
the OLE object in hp:default. The renderer's check lets such charts
through.

Chart tables are bounded (cells counted before repeats expand), with the
chart reader's series and point limits and a ChartBudget per document.
Tests build the charts in code; a fuzz target for the ODF chart reader
and seeds for ODT, ODS printing, HWPX and a chart sheet workbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PDFsharp's Flate, LZW and ASCII85 decoders are replaced by bounded ones that unpack the same bytes the same way: one stream may unpack to 256 MB, and everything a file unpacks while it is opened (object and cross-reference streams, then its pages' content streams) to 1 GB. A refusal goes through error.document_too_complex, also when PDFsharp catches it on the way. A predictor row longer than the data no longer allocates two rows first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the picture windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also make a shared font's typeface once, and test DIB decoding at every depth and row padding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	README.md
# Conflicts:
#	README.md
#	src/Filee.Core/Formats/FormatFields.cs
#	src/Filee.Core/Settings/AppSettings.cs
#	src/Filee.Core/Settings/UserDataStore.cs
#	tests/Filee.Core.Tests/FormatFieldsTests.cs
@KnifeLemon KnifeLemon added the built-in engines Filee: built-in engines (Project 4), on the builtin-engines branch, not released yet label Nov 19, 2026
@KnifeLemon
KnifeLemon merged commit 11d3c73 into builtin-engines Nov 19, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

built-in engines Filee: built-in engines (Project 4), on the builtin-engines branch, not released yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant