Files
EnvelopeGenerator/EnvelopeGenerator.Application/Common/Dto/AnnotationDto.cs
TekH dcb3e5d45d Mark Type obsolete; add X and Y properties
The `Type` property in `AnnotationCreateDto` was marked as obsolete with the note: "Not required for DevExpress."

Added `X` and `Y` properties to represent the horizontal and vertical positions of the signature field on the page. Both properties use DevExpress units (hundredths of an inch) with the origin at the top-left corner of the page.

Detailed documentation was added for `X` and `Y`, including differences in coordinate systems and unit conversions between DevExpress, PSPDFKit, and GDPicture.
2026-05-31 11:11:47 +02:00

105 lines
3.2 KiB
C#

namespace EnvelopeGenerator.Application.Common.Dto;
/// <summary>
///
/// </summary>
public record AnnotationCreateDto
{
/// <summary>
///
/// </summary>
public long Id { get; set; }
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public int ElementId { get; init; } = -1;
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public string Name { get; init; } = string.Empty;
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public string Value { get; init; } = string.Empty;
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public string Type { get; init; } = string.Empty;
/// <summary>
/// Horizontal position of the signature field on the page.
/// <br/><br/>
/// <b>DevExpress unit:</b> Hundredths of an inch (1/100 inch ≈ 2.83 PDF points), origin at the <b>top-left</b> corner of the page, X increases to the right.
/// <br/>
/// <b>Difference from PSPDFKit:</b> PSPDFKit also uses top-left origin but measures in PDF points (1/72 inch).
/// To convert: <c>xDevExpress = xPsPdfKit * (100.0 / 72.0)</c>
/// <br/>
/// <b>Difference from GDPicture:</b> GDPicture uses PDF points with <b>bottom-left</b> origin (standard PDF coordinate system).
/// The X axis is the same direction, only unit conversion is needed: <c>xDevExpress = xGdPicture * (100.0 / 72.0)</c>
/// </summary>
public double? X { get; init; }
/// <summary>
/// Vertical position of the signature field on the page.
/// <br/><br/>
/// <b>DevExpress unit:</b> Hundredths of an inch (1/100 inch ≈ 2.83 PDF points), origin at the <b>top-left</b> corner of the page, Y increases downward.
/// <br/>
/// <b>Difference from PSPDFKit:</b> PSPDFKit also uses top-left origin and Y increases downward, but measures in PDF points (1/72 inch).
/// To convert: <c>yDevExpress = yPsPdfKit * (100.0 / 72.0)</c>
/// <br/>
/// <b>Difference from GDPicture:</b> GDPicture uses PDF points with <b>bottom-left</b> origin, so Y increases <b>upward</b> (PDF standard).
/// To convert: <c>yDevExpress = (pageHeightInPt - yGdPicture - elementHeightInPt) * (100.0 / 72.0)</c>
/// </summary>
public double? Y { get; init; }
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public double? Width { get; init; }
/// <summary>
///
/// </summary>
[Obsolete("Not required for DevExpress")]
public double? Height { get; init; }
/// <summary>
/// Added to eliminate the need for SignatureDto in DevExpress
/// </summary>
public int? Page { get; init; }
}
/// <summary>
///
/// </summary>
public record AnnotationDto : AnnotationCreateDto
{
/// <summary>
///
/// </summary>
public long Id { get; init; }
/// <summary>
///
/// </summary>
public DateTime AddedWhen { get; init; }
/// <summary>
///
/// </summary>
public DateTime? ChangedWhen { get; init; }
/// <summary>
///
/// </summary>
public string? ChangedWho { get; init; }
}