Created
October 16, 2023 09:02
-
-
Save bjoerntx/9b3634aea7e666d91a07fc4da9e7a07d 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 (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) | |
{ | |
tx.Create(); | |
// load DOC or RTF file | |
//tx.Load("mydocument.doc", TXTextControl.StreamType.MSWord); | |
//tx.Load("mydocument.rtf", TXTextControl.StreamType.RichTextFormat); | |
// load DOCX file | |
tx.Load("Documents/mydocument.docx", TXTextControl.StreamType.WordprocessingML); | |
// optionally set the save settings | |
TXTextControl.SaveSettings saveSettings = new TXTextControl.SaveSettings() | |
{ | |
Author = "Text Control", | |
CreationDate = DateTime.Now, | |
CreatorApplication = "TX Text Control Sample Application", | |
DocumentAccessPermissions = TXTextControl.DocumentAccessPermissions.AllowAll | |
}; | |
// save as PDF | |
tx.Save("mydocument.pdf", TXTextControl.StreamType.AdobePDF, saveSettings); | |
Console.WriteLine("Document has been converted!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment