Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created October 23, 2023 09: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/f281a42ea62d1b46970e0bc32c973944 to your computer and use it in GitHub Desktop.
Save bjoerntx/f281a42ea62d1b46970e0bc32c973944 to your computer and use it in GitHub Desktop.
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
string html = File.ReadAllText("sample.html");
string appendHtml = "<html><body><h1>Appended</h1></body></html>";
// load HTML string
tx.Load(html, TXTextControl.StringStreamType.HTMLFormat);
tx.Append(appendHtml,
TXTextControl.StringStreamType.HTMLFormat,
TXTextControl.AppendSettings.StartWithNewParagraph);
// save as PDF
tx.Save("output.pdf", TXTextControl.StreamType.AdobePDF);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment