Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active January 28, 2022 08:20
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/31aa6a8fe5bfb670178b4bcbd97f1e95 to your computer and use it in GitHub Desktop.
Save bjoerntx/31aa6a8fe5bfb670178b4bcbd97f1e95 to your computer and use it in GitHub Desktop.
[HttpGet]
public IActionResult AddWatermark()
{
byte[] bDocument;
// create a ServerTextControl
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
tx.PageUnit = TXTextControl.MeasuringUnit.Twips;
// load the template
tx.Load("App_Data/nda.tx", TXTextControl.StreamType.InternalUnicodeFormat);
AddWatermark(tx, "App_Data/draft.svg");
// save in the internal format
tx.Save(out bDocument, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
}
return Ok(bDocument);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment