diff --git a/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs b/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs index 918bc99f..c1777f41 100644 --- a/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs +++ b/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs @@ -305,7 +305,23 @@ public class BurnPdfCommandHandler : IRequestHandler private void AddImageAnnotation(Annotation pAnnotation, Dictionary pAttachments) { - throw new NotImplementedException(); + var oAttachment = pAttachments + .Where(a => a.Key == pAnnotation.ImageAttachmentId) + .SingleOrDefault(); + + if (oAttachment.Value == null) + return; + + // Convert pixels to Inches + var oBounds = pAnnotation.Bbox.Select(ToInches).ToList(); + + var oX = oBounds[0]; + var oY = oBounds[1]; + var oWidth = oBounds[2]; + var oHeight = oBounds[3]; + + _manager.SelectPage(pAnnotation.PageIndex + 1); + _manager.AddEmbeddedImageAnnotFromBase64(oAttachment.Value.Binary, (float)oX, (float)oY, (float)oWidth, (float)oHeight); } private void AddInkAnnotation(int page, string value)