Helpers.rectToQuad()
A
Rect as a Quad, its corners named as Acrobat writes them.static methodGeometrysince 1.0.0
Signature
rectToQuad(rect: Rect): Quad
Parameters
| Parameter | Type | Description |
|---|---|---|
| rect | Rect | A rectangle in page space. |
Returns
Quad Its four corners as { topLeft, topRight, bottomLeft, bottomRight }.
Example
TypeScript
const [first] = match.rects; const quad = first ? rectToQuad(first) : null;