Free Support Forum -

Converting docx into PDF . Document(.docx) is in Arabic format

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 .


Thanks for your inquiry. Please ZIP and attach your input Word document here for testing. We will investigate the issue on our side and provide you more information.

Thanks for you quick response … issue got fixed … after updating Aspose.Pdf.dll and Aspose.Words.dll


Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.