Created
June 28, 2024 12:07
-
-
Save bjoerntx/d8285b15b9c36f9077dca775837593f0 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 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"; | |
printDocument.PrinterSettings.PrintToFile = true; | |
printDocument.PrinterSettings.PrintFileName = "test.pdf"; | |
tx.Print(printDocument); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment