Hi
I am using Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider() to convert a word document(.docx) to pdf.
This takes a lot of time and gives system out of memory exception when the number of pages in the word document is more than 500.
Below is the code snippet:
using (Stream input = new FileStream("temp.docx"), FileMode.Open))
{var providerDocx = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
var document = providerDocx.Import(input);
var providerPdf = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
Stream outStream = new MemoryStream();
providerPdf.Export(document, outStream);
var fileStream = File.Create("temp.pdf");
outStream.Seek(Constants.Int0, SeekOrigin.Begin);
outStream.CopyTo(fileStream);
fileStream.Close();
}
Please suggest a solution to this or any other alternative which takes less time and memory.