Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created November 13, 2023 18:00
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/25da6397948bacd3108351c36c31e64b to your computer and use it in GitHub Desktop.
Save bjoerntx/25da6397948bacd3108351c36c31e64b to your computer and use it in GitHub Desktop.
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
TXTextControl.Selection selection = new TXTextControl.Selection();
selection.Text = "Hello PDF!";
selection.FontSize = 360;
selection.FontName = "Arial";
selection.ForeColor = System.Drawing.Color.Red;
tx.Selection = selection;
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings()
{
UserPassword = "textcontrol",
MasterPassword = "textcontrol",
DocumentAccessPermissions = TXTextControl.DocumentAccessPermissions.AllowGeneralEditing |
TXTextControl.DocumentAccessPermissions.AllowLowLevelPrinting |
TXTextControl.DocumentAccessPermissions.AllowExtractContents
};
tx.Save("output.pdf", TXTextControl.StreamType.AdobePDF, saveSettings);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment