Created
July 24, 2024 14:03
-
-
Save bjoerntx/c4373752a29586a497ff18a17cc303cb to your computer and use it in GitHub Desktop.
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
[TestClass] | |
public class UnitTest1 | |
{ | |
[TestMethod] | |
public void TestConversion() | |
{ | |
string html = "<html><body><h1>Hello, World!</h1></body></html>"; | |
byte[] pdf = MyTextControlClassLibrary.DocumentProcessing.GeneratePDF(html); | |
Assert.IsNotNull(pdf); | |
// use TX Text Control to load the PDF and check for the text | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
tx.Load(pdf, TXTextControl.BinaryStreamType.AdobePDF); | |
if (tx.Text.Contains("Hello, World!")) | |
{ | |
Assert.IsTrue(true); | |
} | |
else | |
{ | |
Assert.Fail(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment