Class PdfToWordCoordinateMapper
Deterministically maps PDF user-space coordinates to top-left-origin Word page
coordinates. Crop-box origins and all PDF rotations are handled explicitly.
Inheritance
PdfToWordCoordinateMapper
Assembly: DRIT.Document.dll
Syntax
public sealed class PdfToWordCoordinateMapper
Constructors
PdfToWordCoordinateMapper(PdfRect, int)
Initializes a new PdfToWordCoordinateMapper from normalized PDF extraction data.
Declaration
public PdfToWordCoordinateMapper(PdfRect cropBox, int rotation)
Parameters
| Type |
Name |
Description |
| PdfRect |
cropBox |
|
| int |
rotation |
|
Properties
CropBox
Gets the normalized PDF crop box used for coordinate mapping.
Declaration
public PdfRect CropBox { get; }
Property Value
Height
Gets the height of the represented page or bounds in points.
Declaration
public double Height { get; }
Property Value
Rotation
Gets the normalized clockwise page rotation in degrees.
Declaration
public int Rotation { get; }
Property Value
Width
Gets the width of the represented page or bounds in points.
Declaration
public double Width { get; }
Property Value
Methods
MapBounds(PdfRect)
Maps and normalizes the axis-aligned bounds of a PDF object.
Declaration
public PdfLayoutRect MapBounds(PdfRect bounds)
Parameters
| Type |
Name |
Description |
| PdfRect |
bounds |
|
Returns
MapPoint(PdfPoint)
Maps a PDF point, in user-space units, into top-left-origin page coordinates.
Declaration
public PdfLayoutPoint MapPoint(PdfPoint point)
Parameters
| Type |
Name |
Description |
| PdfPoint |
point |
|
Returns
NormalizeRotation(int)
Validates and normalizes a PDF rotation to a supported right-angle value.
Declaration
public static int NormalizeRotation(int rotation)
Parameters
| Type |
Name |
Description |
| int |
rotation |
|
Returns
NormalizeSourceRect(PdfRect)
Normalizes a PDF rectangle so its edges are ordered consistently.
Declaration
public static PdfRect NormalizeSourceRect(PdfRect value)
Parameters
| Type |
Name |
Description |
| PdfRect |
value |
|
Returns