Last active
October 17, 2017 12:10
-
-
Save bjoerntx/725ceb7b1ae1c83b23a95ee078cbcff5 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 (ServerTextControl tx = new ServerTextControl()) | |
{ | |
tx.Create(); | |
// create a new selection range | |
Selection range = new Selection(); | |
range.Bold = true; | |
range.FontSize = 400; | |
range.Text = "This is a new paragraph\r\n"; | |
// insert the range to the document | |
tx.Selection = range; | |
// add a table | |
tx.Tables.Add(5, 5, 10); | |
foreach (TableCell cell in tx.Tables.GetItem(10).Cells) | |
{ | |
cell.Text = cell.Row.ToString() + ", " + cell.Column.ToString(); | |
} | |
// save the document as PDF | |
tx.Save("test.pdf", StreamType.AdobePDF); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment