I'm using .Net 6(C#) with the code below:
- Code: Select all
RectangleF rectangleF = new RectangleF(x, y, width, height);
signature.Bounds = rectangleF;
signature.Certificated = true;
//Set the graphics mode
signature.GraphicsMode = imageSignatureAsBase64 != null ? GraphicMode.SignImageAndSignDetail : GraphicMode.SignDetail;
//Timezone Sao_Paulo UTC-3
signature.DateLabel = $"{locationInfoLabel}, {DateTime.UtcNow.AddHours(-3).ToString("dd/MM/yyyy HH:mm:ss")}";
signature.ContactInfoLabel = contactInfoLabel;
signature.DistinguishedNameLabel = "Assinado digitalmente por Orizon";
signature.ReasonLabel = $"Certificado: {cert.GetNameInfo(X509NameType.SimpleName, false)}";
//Set the signature content
if (imageSignatureAsBase64 != null)
{
MemoryStream msImageSignature = new MemoryStream(Convert.FromBase64String(imageSignatureAsBase64));
signature.SignImageSource = PdfImage.FromStream(msImageSignature);
}
//Save to another stream file
MemoryStream msResult = new();
doc.SaveToStream(msResult);
doc.Close();
Does anyone know what I can do to fix this problem?
Thanks!