Created
March 18, 2025 11:47
-
-
Save bjoerntx/8c0c342c7c4614a3d1f5d1dd4619593c to your computer and use it in GitHub Desktop.
This file contains hidden or 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; | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
// Add a paragraph to the document | |
TXTextControl.Selection selection = new TXTextControl.Selection(0, 0); | |
selection.Text = "Hello, Linux!"; | |
// Set the paragraph format | |
selection.ParagraphFormat = new ParagraphFormat() | |
{ | |
Alignment = HorizontalAlignment.Center, | |
BackColor = System.Drawing.Color.LightGray, | |
Frame = Frame.BottomLine, | |
FrameLineColor = System.Drawing.Color.Red, | |
FrameStyle = FrameStyle.Double, | |
FrameLineWidth = 10, | |
}; | |
// Set the font format | |
selection.FontSize = 240; // 240 twips = 12 pt | |
selection.FontName = "Arial"; | |
selection.Bold = true; | |
// Apply the changes to the document | |
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