Created
July 24, 2024 13:40
-
-
Save bjoerntx/935d14cfc3e19cc0f90ee498cc06ee09 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
namespace MyTextControlClassLibrary | |
{ | |
public static class DocumentProcessing | |
{ | |
static DocumentProcessing() { | |
TXTextControl.ServerTextControl.EntryAssembly = | |
typeof(DocumentProcessing).Assembly; | |
} | |
public static byte[] GeneratePDF(string html) | |
{ | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) | |
{ | |
byte[] data; | |
tx.Create(); | |
tx.Load(html, TXTextControl.StringStreamType.HTMLFormat); | |
tx.Save(out data, TXTextControl.BinaryStreamType.AdobePDF); | |
return data; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment