Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142931 | Feb 26,2019 09:59 AM UTC | Mar 6,2019 06:24 PM UTC | ASP.NET Core - EJ 2 | 6 |
![]() |
Tags: DocIO |
static void Main(string[] args)
{
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("MY_KEY");
string inputFile = "input_file_path";
string outputFile = "Sample Output.docx";
File.Copy(inputFile, outputFile, true);
FileStream fileStream = new FileStream(outputFile, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
WordDocument doc = new WordDocument(fileStream, FormatType.Docx);
DocIORenderer converter = new DocIORenderer();
converter.Settings.AutoDetectComplexScript = true;
converter.Settings.EmbedFonts = true;
converter.Settings.EmbedCompleteFonts = true;
PdfDocument pdfDocument = converter.ConvertToPDF(doc);
FileStream pdfStream = File.Create("output.pdf");
pdfDocument.Save(pdfStream);
pdfDocument.Dispose();
pdfStream.Dispose();
doc.Dispose();
fileStream.Dispose();
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.