Repository navigation
Fix #407, #410: repeat Excel print title rows in PDF, read HP-GL plot files (.plt) - #432
Conversation
…n#407) XLSX keeps its rows to repeat at the top (the _xlnm.Print_Titles name) and the HWPX tables start every page with them, as frozen rows did. Rows above the titles come once, before them.
HpglPlot reads HP-GL and HP-GL/2 (also the packed PE polylines printer drivers write, inside PJL / PCL) and draws the pen moves as SVG at real size; the vector engine renders PDF and images from there. Settings schema 33 teaches the vector donut .plt, .hpgl, .hpg and .hgl.
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks @cre8ive-marketing. The print titles part looks right to me: localSheetId counted with hidden sheets, rows above the titles once in their own table, and frozen rows exactly as before when there are no print titles. I ran the new tests locally (HpglPlotTests, the print-title tests, the tracing guard and PltFormatTests): all pass.
Two things on the plot reader:
-
HP-GL/1 files that don't start with IN, BP, SP, PU, PA or DF are refused. I tried four valid plots and each failed with "No HP-GL drawing found":
- device-control sequences first, as cutting plotters and older CAD drivers write them:
ESC.(;ESC.I81;;17:ESC.N;19:IN;SP1;PU0,0;PD400,0,400,400; IP0,0,4000,4000;SC;SP1;PU0,0;PD…- a leading ETX (
\x03IN;…) - a comment first:
CO"made by x";IN;…
StartsWithHpglonly knows six commands, and every ESC jumps to the nextESC%…B, which an HP-GL/1 file never has. Please skipESC .sequences (a single letter, or parameters ending in:) and accept any two-letter mnemonic at the start, with a test per case. - device-control sequences first, as cutting plotters and older CAD drivers write them:
-
Reference names. We don't name projects that were only read to check a format, so please drop the ezdxf mentions from the
HpglPlot.csheader and theHpglPlotTests.csheader. Describing the PE encoding in your own words, as theDecodeNumberssummary already does, is enough.
Settings schema 33 and the TracingTests.IsTracing line shared with #401 we'll sort out when merging, as you suggested. CI for fork runs is waiting for approval; we'll start it.
Device-control sequences (ESC . …) are skipped, a CO comment's quoted text stays its argument, and any command may come first, so plots opening with ESC .(, IP / SC, ETX or a comment are read. The header no longer names the project only read to check PE.
|
@KnifeLemon Thanks for testing those plots. Both points are fixed in b3a8ce7:
|
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks @cre8ive-marketing, both points are covered. I ran the HP-GL, print title and spreadsheet tests on b3a8ce7 here (69 pass), and the four plots that were refused before now draw the same square.
Two small things we'll do on our side when merging, nothing needed from you: the settings migration gets the next free schema number (#351 also uses 33 and goes in first), and the strings for any language added in the meantime.
|
Merged through #464, thanks @cre8ive-marketing! Its settings migration became schema 35. It'll be in the next release. |
The HP-GL plot-file step becomes v35 after KnifeLemon#393's v34, AppSettings.CurrentSchemaVersion goes to 35 and the migration test starts from 34. KnifeLemon#432 adds no UI strings; all 13 language files already match en.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne text for fr, zh-TW, ne The iCalendar step becomes v36 after KnifeLemon#432's v35, AppSettings.CurrentSchemaVersion goes to 36 and the iCalendar migration test starts from 35. engine.data.description now names iCalendar events in English; French and Traditional Chinese still said vCard only, and Nepali had an older one-line text. All three now say what the English one says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What does this change?
Fixes a bug from #407 and adds a format from #410. There is one commit for each, with tests and a line in
docs/ENGINES.md.Now:
XlsxReaderreads the_xlnm.Print_Titlesdefined name of each sheet, matched bylocalSheetId(hidden sheets count in that index).Worksheet.TitleRowsstores the rows.SheetDocumentstarts every page's table with those rows as HWPX header rows. Rows above the print titles (a document title) appear once, in a table before them. Without print titles, frozen rows repeat exactly as before..plt, also.hpgl,.hpg,.hgl) are a new read-only vector format.Vector/HpglPlot.csdraws the pen moves as SVG polylines at the plot's real size (40 units per mm), with pen colours (SP,PC) and widths (PW). The vector engine renders PDF, PNG, JPG, … from that SVG.Read:
IN,PU/PD/PA/PR,CI,AA/AR, polygons (PM/EP/FP), and the packedPEpolylines that Windows printer drivers (AutoCAD "plot to file") write inside a PJL/PCL wrapper.Not drawn: text labels (
LB), fill patterns and raster data.SCscaling is ignored.A
.pltwithout HP-GL (PostScript or PCL raster output) fails with that reason.Settings schema 33 teaches the vector donut
.plt,.hpgl,.hpgand.hgl, unless the user's own donut already claims them. Like #351, #393, #401 and #429, this uses schema 33, so it needs renumbering after #351. Happy to do that, or leave it to you.Overlap with #401: both PRs change
TracingTests.IsTracingin the same line. #401 adds"dst", this one adds"plt":step.From is not ("svgz" or "plt"). Whichever merges second should keep both:("svgz" or "dst" or "plt").The PE sample in the tests was encoded independently of Filee's decoder, so the decoder isn't only checked against itself.
How was it tested?
dotnet format --verify-no-changesdotnet testwith FFmpeg 9.0.2, rhwp 0.8.7 and Tesseract 5.4: Platform 48, Core 457, Cli 27, Setup 145, Engines 1467, App 807 pass, none fail.OfficeTests(엑셀-PDF 행 반복이 적용이 안됩니다. #407):PrintTitleRows: a quoted sheet name; columns and rows together ($A:$B,$1:$2); columns only gives none.HpglPlotTests(Format request: .plt #410):PEplot (square, pen change, move, 0.5 mm pen width);PCcolour;.plt→ SVG (24 mm wide), PNG and PDF through the job queue;.pltfails with the reason.PltFormatTests(Core): the format entry for.pltand.hpgl, and the schema 32 → 33 upgrade.Screenshots (UI changes)
No UI changes.
Checklist
src/Filee.App/Assets/i18n/*.jsonfiles (none added)THIRD-PARTY-NOTICES.md(none)Fixes #407. Fixes #410.