We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

After converting word file to text file using ASPOSE.WORD.net mail merge .It is showing junk characters while opening it in binary mode. Reported by one of our client

I am using latest licensed version of ASPOSE.Words.NET.I have implemented it in our existing project. Earlier we are using word automation using word object with .Net. But due to huge number of documents generation by the end of day we were facing scalabilities issues. So we decide to purchase ASPOSE.WORD.NET.

Now we are facing problem while converting “.docx” files as a “.txt” file with ASPOSE.WORD.NET. It is showing junk characters (before Standard word in attached file) while opening it in binary mode. Reported by one of our client.

However our existing solution is working fine. I am attaching a two text files on them is generated using MSWORD and another is using ASPSOE.Word.

Hope you will suggest a solution ASAP.

You can replicate this by downloading text pad (http://www.textpad.com/download/) and open the file as Binary.

Hi Anil,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document DOCX
  • Please create a standalone console application (source code without compilation errors) that helps us reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click ‘Reply’ button that will bring you to the ‘reply page’ and there at the bottom you can include any attachments with that post by clicking the ‘Add/Update’ button.

Best regards,

Thanks for your reply Now i am sending the sample Project.My concern is that when i created txt file with aspose its encoding type is changed. The two text file one with ASPOSE and another is normally created with writestream(…) method both are Binary different.Which should not be according to my client.

Please suggest so we can have same binary encoding type of Txt files,because UTF -8 BOM type encoding producing junk characters.

Anil Kumar Maurya

Hi Anil,

Thanks for your inquiry. We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem as WORDSNET-14613 in our issue tracking system. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Best regards,
Hi Anil,

Regarding WORDSNET-14613, our product team has completed the work on your issue and has come to a conclusion that this is not a bug in Aspose.Words. Your issue (WORDSNET-14613) will be closed with 'Not a Bug' resolution. Please use the following code to fix this issue. You need to provide correct encoding before saving document to "txt". Just replace this line


in "Main" method of the attached example with the following code:

TxtSaveOptions so = new TxtSaveOptions();
so.Encoding = System.Text.Encoding.Default;
doc.Save(datadirPath, so);

Hope, this helps.

Best regards,