Created
July 28, 2021 14:16
-
-
Save bjoerntx/c3e4e579f5706f41ca43779c5484212b 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
[ApiController] | |
[Route("api/[controller]")] | |
public class TextControlController : ControllerBase | |
{ | |
[HttpGet] | |
[Route("LoadDocument")] | |
public TextControlDocument LoadDocument(string DocumentName) { | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { | |
tx.Create(); | |
tx.Load("App_Data/" + DocumentName, TXTextControl.StreamType.WordprocessingML); | |
byte[] data; | |
tx.Save(out data, TXTextControl.BinaryStreamType.InternalUnicodeFormat); | |
return new TextControlDocument() { Document = Convert.ToBase64String(data) }; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment