refactor(ISignature): create to handle common properties of a signature
- implement to entity and dto
This commit is contained in:
parent
94ce416aa1
commit
bf0bd8e9e7
@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Application.Common.Dto;
|
||||
|
||||
@ -6,7 +7,7 @@ namespace EnvelopeGenerator.Application.Common.Dto;
|
||||
/// Data Transfer Object representing a positioned element assigned to a document receiver.
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(IgnoreApi = true)]
|
||||
public class SignatureDto
|
||||
public class SignatureDto : ISignature
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the element.
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.ComponentModel;
|
||||
using EnvelopeGenerator.Domain.Interfaces;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
#if NETFRAMEWORK
|
||||
@ -13,7 +14,7 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
#endif
|
||||
|
||||
[Table("TBSIG_DOCUMENT_RECEIVER_ELEMENT", Schema = "dbo")]
|
||||
public class Signature
|
||||
public class Signature : ISignature
|
||||
{
|
||||
public Signature()
|
||||
{
|
||||
|
||||
11
EnvelopeGenerator.Domain/Interfaces/ISignature.cs
Normal file
11
EnvelopeGenerator.Domain/Interfaces/ISignature.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace EnvelopeGenerator.Domain.Interfaces
|
||||
{
|
||||
public interface ISignature
|
||||
{
|
||||
int Page { get; set; }
|
||||
|
||||
double X { get; set; }
|
||||
|
||||
double Y { get; set; }
|
||||
}
|
||||
}
|
||||
@ -226,12 +226,18 @@ public class EnvelopeController : ViewControllerBase
|
||||
{
|
||||
using var pdf = Pdf.FromMemory(doc.ByteData).Design(1, canvas =>
|
||||
{
|
||||
canvas.SetStrokeColor(ColorConstants.RED);
|
||||
canvas.SetFillColor(ColorConstants.CYAN);
|
||||
canvas.SetFillColorRgb(222, 220, 215);
|
||||
canvas.SetLineWidth(2);
|
||||
canvas.SetFillColor(new DeviceRgb(135, 62, 35));
|
||||
|
||||
canvas.Rectangle(100, 500, 200, 100);
|
||||
|
||||
canvas.Fill();
|
||||
|
||||
canvas.SetFillColor(new DeviceRgb(222, 220, 215));
|
||||
|
||||
canvas.SetStrokeColor(new DeviceRgb(135, 62, 35));
|
||||
canvas.Circle(300, 500, 100);
|
||||
canvas.FillStroke();
|
||||
canvas.Fill();
|
||||
});
|
||||
|
||||
doc.ByteData = pdf.ExportAsBytes();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user