If I use a jpg, the function will work, if I use a SVG, the function will not work.
How do I get this function to work with a SVG image?
private Stream ProcessHandSignatures(Stream pdfReader, Stream signatureFileStream, string signatureFieldName) { if (signatureFileStream !=null) { Document pdfDocument = new Document(pdfReader); // Add SVG to Signature field in PDF PdfFileMend mender = new PdfFileMend(pdfDocument); Field result = Array.Find(pdfDocument.Form.Fields, p => p.FullName == signatureFieldName); if (result != null) { // Get coordinates of signature field int pageIndex = pdfDocument.Form[signatureFieldName].PageIndex; Rectangle sigRectangle = pdfDocument.Form[signatureFieldName].GetRectangle(false); // Add image over signature field mender.AddImage(signatureFileStream, pageIndex, (float)sigRectangle.LLX, (float)sigRectangle.LLY, (float)sigRectangle.URX, (float)sigRectangle.URY); // Remove signature field removeField(pdfDocument, signatureFieldName); // Save pdfDocument.Save(pdfReader); } } return pdfReader; }