Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created June 7, 2024 10:55
Show Gist options
  • Save bjoerntx/b037e9658e67d522cb7092c70cd87d88 to your computer and use it in GitHub Desktop.
Save bjoerntx/b037e9658e67d522cb7092c70cd87d88 to your computer and use it in GitHub Desktop.
using TXTextControl.ServerTextControl serverTextControl = new TXTextControl.ServerTextControl();
serverTextControl.Create();
serverTextControl.Text = "I am a PDF document!\fPage2\fPage3\fPage4\fPage5";
var jsAlert = "app.alert('This is a JavaScript alert!');";
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings()
{
DocumentLevelJavaScriptActions = new string[] { jsAlert }
};
serverTextControl.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