Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created March 28, 2023 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/45140189d761c9be8ec66446f6290060 to your computer and use it in GitHub Desktop.
Save bjoerntx/45140189d761c9be8ec66446f6290060 to your computer and use it in GitHub Desktop.
public IActionResult Index() {
ViewModel model = new ViewModel();
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
tx.Load("App_Data/lease_agreement.tx", TXTextControl.StreamType.InternalUnicodeFormat);
string svgSources = tx.GetPages()[1].GetImage(TXTextControl.Page.PageContent.All, 300);
model.svgImage = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(svgSources));
}
return View(model);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment