Created
April 5, 2024 19:22
-
-
Save bjoerntx/71e4367afd2f5e563c34b22f74a5c285 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
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
var sHtml = "<strong>This is a <span style=\"color: red;\">sample</span> <u>document</u>!</strong>"; | |
tx.Load(sHtml, TXTextControl.StringStreamType.HTMLFormat); | |
// adding a header | |
tx.HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header); | |
var header = tx.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header); | |
header.Selection.Text = "This is the header"; | |
// save the document | |
tx.Save("results.pdf", TXTextControl.StreamType.AdobePDF); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment