PeachPDF

PeachPDF.ClippedWord

ClippedWord(string, double, double, double, double) Constructor

One word that was DRAWN into the content stream and then truncated by a clip.

public ClippedWord(string Text, double DrawnWidth, double VisibleWidth, double DrawnHeight, double VisibleHeight);

Parameters

Text System.String

The word as it was drawn.

DrawnWidth System.Double

Width of the word’s own rect, before the clip was applied.

VisibleWidth System.Double

Width that survived the clip. Less than DrawnWidth when width was a clipped dimension; EQUAL to it for a word clipped only vertically, which is recorded too — a box short enough to cut a line’s height but wide enough to keep the whole word is the same silent loss.

DrawnHeight System.Double

Height of the word’s own rect, before the clip was applied.

VisibleHeight System.Double

Height that survived the clip.

Remarks

This exists because reading the finished PDF cannot detect this class of loss. A glyph that was emitted and then truncated by the PDF clip operator is still IN the content stream, so a reader that parses that stream finds it and reports the word present, while a renderer that honours the clip shows only part of it. Measured with the two as an oracle pair on a table cell narrower than its content: PdfPig reads every character back and reports the document complete; MuPDF cannot find the text at all. Both are correct — the difference is simply not recorded in the file. So the engine, at the moment it decides to draw, is the only thing that can report it.

It is deliberately ADDITIVE to reading the output back, never a replacement. A content-stream reader answers “did the glyph land in the file”; an engine-side collector answers “did the painter intend to emit it”, and the two catch different defects — a document declaring one image where the PDF contains zero is caught only by the former.

It UNDER-reports, and that is the safe direction but must not be mistaken for completeness. The clip this is measured against is Canvas’s tracked rect stack, and two clips never reach it: a border-radius or clip-path clip (the path-clip push deliberately leaves the tracked bound over-wide, and the exclude-push is a no-op), and the page-level PdfGraphics.IntersectClip the PDF generator applies outside the stack. So “nothing reported” is a weaker statement than “nothing was clipped”.