Hi!
Thanks for the response. Here is the input *.docx file and output *.pdf file.
The code I used is:
using (MemoryStream mem = new MemoryStream())
{
mem.Write(Input, 0, Input.Length);
//Loads an existing Word document
WordDocument wordDocument = new WordDocument(mem, FormatType.Docx);
//Initializes the ChartToImageConverter for converting charts during Word to pdf conversion
wordDocument.ChartToImageConverter = new ChartToImageConverter();
//Sets the scaling mode for charts (Normal mode reduces the Pdf file size)
wordDocument.ChartToImageConverter.ScalingMode = ScalingMode.Normal;
//Creates an instance of the DocToPDFConverter - responsible for Word to PDF conversion
DocToPDFConverter converter = new DocToPDFConverter();
//Sets ExportBookmarks for preserving Word document headings as PDF bookmarks
converter.Settings.ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.None;
//Sets true to enable the fast rendering using direct PDF conversion.
converter.Settings.EnableFastRendering = true;
//Converts Word document into PDF document
PdfDocument pdfDocument = converter.ConvertToPDF(wordDocument);
using (MemoryStream mem2 = new MemoryStream())
{
//Saves the PDF file to file system
pdfDocument.Save(mem2);
//Closes the instance of document objects
pdfDocument.Close(true);
wordDocument.Close();
Output = mem2.ToArray();
}
}
It is almost the same as what is found in the documentation for DocIO.
Thanks!
Attachment:
Equations_a8356b7f.rar