Repository navigation
Built-in engines W26: PDF to editable slides, mind maps, chart templates and ODF charts, PDF stream limits - #1712
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
PdfOptions.SlidePictures,presets.slide_pictures*in 23 locales).Mind maps (#1543, #1004)
.mmand 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.error.xmind_password. A.mmthat isn't XML (Objective-C++) is read as text.content.jsonnesting is checked before parsing; existing XML and package limits apply..mmand.xmind.Charts
.crtxchart templates → PDF / SVG / PNG ([Format]: .crtx #1354), with Office's sample values when the template has none. Unsupported template types are refused witherror.chart_template_unsupported. Settings schema v109: the vector donut learns.crtx.Workbook.ChartSheets).OdfChartReader) drawn in ODT, ODP/ODG and ODS. The left-out notice counts undrawn ODF charts as charts (charts_pictured).hp:chartdrawn from its OOXML chart part, falling back to the OLE object.Security and tests
DocumentLimits.MaxPdfStreamBytes, and each PDFsharp open runs in a total budget. Relies on PDFsharp staying at 6.2.4; a test checks the swap.ImageReader.ReadfromHwpxWriter,PandocConverterandHideService; picture windows cancel the read when they close.NsisReaderTestshides 7-Zip per test (AsyncLocal) instead of for the whole process.WmfPlayer.Bitmap16, a temporarySKDatathat could be freed duringSKTypeface.FromData, a racy lazy typeface. NewDibStrideTests. The crash itself isn't reproduced;--blame-crashwill name the test next time.Merge notes
FormatFieldsand the General grade count (105) combined from the mind map and chart branches.Tests
Run locally on the merged branch:
dotnet format --verify-no-changes --severity warnclean on Engines, Core and their tests🤖 Generated with Claude Code