Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created May 24, 2022 13:34
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/df61f2aeb13af9ea4737c03b8e3dce8c to your computer and use it in GitHub Desktop.
Save bjoerntx/df61f2aeb13af9ea4737c03b8e3dce8c to your computer and use it in GitHub Desktop.
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
// insert a table
tx.Tables.Add(3, 3, 10);
foreach (TXTextControl.TableCell tableCell in tx.Tables.GetItem(10).Cells) {
tableCell.Text = "Row " +
tableCell.Row.ToString() +
", Col " + tableCell.Column.ToString();
tableCell.CellFormat.BottomBorderWidth = 10;
}
// create a selection object
TXTextControl.Selection selection = new TXTextControl.Selection() {
FontSize = 500,
Text = "Welcome to Text Control",
Bold = true,
ForeColor = System.Drawing.Color.DarkRed
};
// apply the selection
tx.Selection = selection;
// 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