Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active January 27, 2022 10:43
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/0a506e44fdea16943e44adff0028db86 to your computer and use it in GitHub Desktop.
Save bjoerntx/0a506e44fdea16943e44adff0028db86 to your computer and use it in GitHub Desktop.
[HttpPost]
public IActionResult CreatePDF([FromBody] TransferDocument document) {
// create a ServerTextControl
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
tx.Load(Convert.FromBase64String(document.Document),
TXTextControl.BinaryStreamType.InternalUnicodeFormat);
byte[] bPDF;
tx.Save(out bPDF, TXTextControl.BinaryStreamType.AdobePDF);
return Ok(bPDF);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment