To this point we’ve been doing a simple text replacement with a person’s name when they sign a contract. We would like to update this to replace the text with an image of their signature, but I’m not sure how to do it. Here’s what we have to do the basic text replacement.
So far in my searching, I’ve only come across one instance where someone tried to do this and wasn’t able to, but they were referencing an image in google drive. Ideally, if possible, I’d like to simply provide the base64 image data to create the image instead of having to go through the hassle of uploading an image to drive, getting the id, inserting it, then later deleting the image to clean things up. For reference, this is in .net.
So, in the code below, we’d like to replace Client Signature: _____________________________
with Client Signature: *inline image*
var body = new BatchUpdateDocumentRequest
{
Requests = new List<Request>
{
new Request
{
ReplaceAllText = new ReplaceAllTextRequest
{
ContainsText = new SubstringMatchCriteria
{
Text = "Client Signature: _____________________________",
MatchCase = false
},
ReplaceText = "Client Signature: " + signedDoc.SignatureName
}
},
new Request
{
ReplaceAllText = new ReplaceAllTextRequest
{
ContainsText = new SubstringMatchCriteria
{
Text = "By: ______________________________________",
MatchCase = false
},
ReplaceText = "By: Electronically"
}
},
new Request
{
ReplaceAllText = new ReplaceAllTextRequest
{
ContainsText = new SubstringMatchCriteria
{
Text = "Date: _____________________________________",
MatchCase = false
},
ReplaceText = "Date: " + signedDoc.SignedDate.ToShortDateString()
}
}
}
};
docService.Documents.BatchUpdate(body, signedDoc.GoogleDocId).Execute();