when I am trying to convert Docx file to PDF where the document is in Arabic format. Getting error
Error Message :
The server was unable to process the request. —> The document appears to be corrupted and cannot be loaded. —> Object reference not set to an instance of an object.’
string FilePath = @“D:\Temp”;
string FileName = FilePath + “Test_Arabic.docx”;
// Load the document. Document doc = new Document(FileName); // Create a new memory stream. MemoryStream outStream = new MemoryStream(); // Save the document to stream. doc.Save(outStream, SaveFormat.Docx); // Convert the document to byte form. byte docBytes = outStream.ToArray(); // The bytes are now ready to be stored/transmitted. // Now reverse the steps to load the bytes back into a document object. MemoryStream inStream = new MemoryStream(docBytes); // Load the stream into a new document object. Document loadDoc = new Document(FileName); string save = FilePath + "Temp_Arabic.pdf"; loadDoc.Save(save, SaveFormat.Pdf);
the above code is working for English language document .