Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created June 28, 2024 12:08
Show Gist options
  • Save bjoerntx/31456fe23752cd91e76816a119ed59c3 to your computer and use it in GitHub Desktop.
Save bjoerntx/31456fe23752cd91e76816a119ed59c3 to your computer and use it in GitHub Desktop.
using System.Drawing.Printing;
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
tx.Load("test.docx", TXTextControl.StreamType.WordprocessingML);
PrintDocument printDocument = new PrintDocument();
printDocument.PrinterSettings.PrinterName = "Microsoft Print to PDF";
tx.Print(printDocument);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment