Worth a looka fix or feature you may wantThe upstream test report still records the pre-existing MetafileRenderingAndOrientation #3 failure on FPC 3.2.2 Win32; this edition does not claim to fix it.
EMF lines now keep the right stroke and path boundaries in PDF output
The PDF engine fixes several EMF line-record cases that could omit a line, paint it with a later shape, or emit redundant stroke operators. The change matters to Delphi and FPC applications that convert Windows metafiles to PDF; a separate test-only commit makes the same PDF regression suite deterministic on scaled displays.
TL;DR
- mormot.ui.pdf now ends or strokes EMF LineTo, Arc, ArcTo and polyline geometry immediately when it is outside a recorded GDI path.
- PDF regression tests now force ScreenLogPixels to 96, avoiding DPI-dependent hashes and coordinates without changing application output.
Upgrade advice
Applications that render Windows EMF content into PDF should land on merged revision ea5a2bbb6a5750f9fd60f21253fb8c5c4bb4cf67, build 2.4.17677, and compare representative documents containing lines, arcs and null pens. The raw payload lists no superseding fix for either non-merge commit; other backends have no urgent reason to update for this edition alone.
2 of 2 entries · 4 commits upstream
1
Medium
EMF line records no longer leak into later PDF shapes or lose their stroke
In mormot.ui.pdf, TPdfCanvas.NewPath now only emits the PDF n operator instead of also changing fNewPath. TPdfEnum confines fNewPath to the EMR_BEGINPATH/EMR_ENDPATH bracket, removes fInLined, and makes LineTo, Arc, ArcTo, PolylineTo and related line records outside that bracket either Stroke with a real pen or NewPath with a null pen. FillRectangle no longer carries the ResetNewPath parameter. New EmfNullPenLines and EmfLineAfterEndedPath tests cover null pens, ended paths and later shapes.
Fixes
mormot.ui.pdf
c5a9ae27+196-86
ui: pdf - lines outside a path are stroked or ended in their own record
Impact
Windows EMF content converted to PDF no longer drops PolylineTo output, leaves null-pen geometry for a later shape to paint, or emits a pending duplicate stroke after a normal line. Existing Delphi and FPC application code and public signatures are unchanged; only generated PDF path behaviour changes. The upstream matrix passed on Delphi 7/13 and FPC Win64, while retaining the known unrelated FPC 3.2.2 Win32 test failure.
Upgrade recommended
Upgrade PDF-producing services that ingest Windows EMF, then compare documents containing LineTo, Arc, ArcTo, PolylineTo and null-pen records against their previous output.
Units
2
Low
PDF metafile tests now use fixed 96-DPI coordinates on scaled screens
The test.ui.pdf helpers MetafileRenderingAndOrientation and RenderedEmf now set TPdfDocumentGdi.ScreenLogPixels to 96 before rendering. This keeps the expected coordinates, output length and hash independent of the real screen DPI when the test executable is DPI-aware.
Tests
test.ui.pdf
9b2ab725+2-0
test: pdf - the metafile checks expect a 96 DPI screen on any screen
Impact
This changes only the regression-test setup. Delphi and FPC applications do not receive a new default and their PDF scaling remains unchanged; developers running the suite on a 125%, 150% or other scaled Windows display should stop seeing DPI-dependent failures in these checks.