Skip to content

Commit

Permalink
Hooked MetafileImageParsed event for SystemClipboard API also.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thamizhselvanv committed Mar 14, 2023
1 parent 1d3335a commit 7dc3350
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -152,7 +152,11 @@ public string SystemClipboard([FromBody]CustomParameter param)
{
try
{
//Hooks MetafileImageParsed event.
WordDocument.MetafileImageParsed += OnMetafileImageParsed;
WordDocument document = WordDocument.LoadString(param.content, GetFormatType(param.type.ToLower()));
//Unhooks MetafileImageParsed event.
WordDocument.MetafileImageParsed -= OnMetafileImageParsed;
string json = Newtonsoft.Json.JsonConvert.SerializeObject(document);
document.Dispose();
return json;
Expand Down

0 comments on commit 7dc3350

Please sign in to comment.