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

Free Support Forum - aspose.com

On downloading text document all left aligned spaces got removed

I am working on text document and when creating document using input stream all left spaces of doc got removed pls suggest…
below code I am using…

public AsposeWordDocument(InputStream documentInputStream, String name) throws AsposeException {
    this.name = name;
    try {
        this.document = new Document(documentInputStream);
        documentBuilder = new DocumentBuilder(document);
        LOG.debug(name + " has " + document.getPageCount() + " pages");
    } catch (Exception ex) {
        throw new AsposeException(ex);

@shivp Could you please attach your input output and expected output documents here for our reference? We will check the issue and provide you more information.

Input: input-output sample.zip (1.9 KB)

zip contains input and output sample files expected output should be same as input.

we are saving input file the DB in varbinary(max) format and at the time of download we convert it to byte array and creating aspose Document from same stream and alignment got changed.

@shivp By default upon loading TXT document leading spaces are converted to indents. You can control this behavior by specifying the appropriate property in TxtLoadOptions:

TxtLoadOptions options = new TxtLoadOptions();
Document doc = new Document("C:\\Temp\\Input sample.txt", options);

thanks alexey

I am using below version and can’t see these class TxtLoadOptions.

please let me know which one stable version I should use?

@shivp Unfortunately, the mentioned options are not available in 16.11 version of Aspose.Words. They were introduced in 18.7 version:

So I would suggest you to update your version of Aspose.Words.

1 Like

is this available for free?
please ping me maven dependancy

@shivp Every Aspose license provides a 1-year subscription for free upgrades to any new Aspose.Words version that comes out. Any Aspose.Words version released before the subscription expiry date - you can just download and use it.

If you want to check when your subscription expires, open the license file in Notepad (but take care not to modify and save the license file or it will no longer work) and see the SubscriptionExpiry field.


It means that you can free upgrade to version of Aspose.Words published before 02/18/2022.

You can get Aspose.Words for Java from our maven repository:

A post was split to a new topic: Issues while applying license