Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created July 24, 2024 13:40
Show Gist options
  • Save bjoerntx/935d14cfc3e19cc0f90ee498cc06ee09 to your computer and use it in GitHub Desktop.
Save bjoerntx/935d14cfc3e19cc0f90ee498cc06ee09 to your computer and use it in GitHub Desktop.
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