This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string url = "https://www.textcontrol.com/img/corporate_id/tx_logo.svg"; | |
using (WebClient client = new WebClient()) | |
{ | |
byte[] bytes = client.DownloadData(url); | |
using (MemoryStream ms = new MemoryStream( | |
bytes, 0, bytes.Length, writable: false, publiclyVisible: true)) | |
{ | |
// create image object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string imagePath = "Images/signature1.jpg"; | |
byte[] bytes = File.ReadAllBytes(imagePath); | |
using (MemoryStream ms = new MemoryStream( | |
bytes, 0, bytes.Length, writable: false, publiclyVisible: true)) | |
{ | |
// create image object | |
TXTextControl.Image myImage = new TXTextControl.Image(ms); | |
textControl1.Images.Add(myImage, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string imagePath = "Images/signature1.jpg"; | |
// load image into memory stream | |
MemoryStream ms = new MemoryStream(); | |
Image img = Image.FromFile(imagePath); | |
img.Save(ms, img.RawFormat); | |
// create image object | |
TXTextControl.Image myImage = new TXTextControl.Image(ms); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string imagePath = "Images/signature1.jpg"; | |
System.Drawing.Image img = System.Drawing.Image.FromFile(imagePath); | |
TXTextControl.Image myImage = new TXTextControl.Image(img); | |
textControl1.Images.Add(myImage, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string imagePath = "Images/signature1.jpg"; | |
TXTextControl.Image myImage = new TXTextControl.Image() { | |
FileName = imagePath }; | |
textControl1.Images.Add(myImage, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public DocumentComparison(TXTextControl.TextControl originalDocument, TextControl revisedDocument) | |
{ | |
// Initialize document references | |
m_originalDocument = originalDocument; | |
m_revisedDocument = revisedDocument; | |
// Enable track changes in the original document | |
originalDocument.IsTrackChangesEnabled = true; | |
// Compare paragraphs between the original and revised documents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static List<(string word, int charIndex, string replacedWord)> CompareSentences(string sentence1, string sentence2) | |
{ | |
string[] words1 = sentence1.Split(' '); | |
string[] words2 = sentence2.Split(' '); | |
List<(string word, int charIndex, string replacedWord)> differences = | |
new List<(string word, int charIndex, string replacedWord)>(); | |
// Track the character index | |
int charIndex = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static List<string> ExtractSentences(string input) | |
{ | |
List<string> sentences = new List<string>(); | |
// Use regular expression to split the input string into sentences but keep white spaces | |
string pattern = @"([.!?])"; | |
// split the input string into sentences with the delimiters | |
string[] splitSentences = Regex.Split(input, pattern); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentComparison dc = new DocumentComparison(textControl1, textControl2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IActionResult Index() | |
{ | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
tx.Load("App_Data/gpay_application.tx", TXTextControl.StreamType.InternalUnicodeFormat); | |
var jsonData = System.IO.File.ReadAllText("App_Data/data.json"); | |
using (MailMerge mm = new MailMerge()) |
NewerOlder