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

Free Support Forum - aspose.com

View document created using Aspose.word JAVA API in edit mode from application

Hi,

We have created the word document using Aspose.word API and now need to open this created document to user within application in read only and edit mode.

Document doc = new Document(<filename.docx>) created is only loading document in memory.

How we can use this to be viewed by user.

Not sure if this is possible using API.

I am only using Apsose.Word API for now.

Secondly, extended query to above, if we need to create a new document using ASPOSE, where we can create a blank document and open it for user and he/she can add some text/select fields for mail merge and save it back.

Any direction to solve this would be really helpful.

Regards
Raghvesh

@raghvesh,

Thanks for your inquiry. Aspose.Words for .NET is just a class library and with it you can programmatically generate, modify, convert, render and print documents without utilizing Microsoft Word®. So, it does not offer any UI or web control to view/perform document processing tasks.

If you just want to view pages of document, you can convert all pages in your Word document to images and use them according to your requirement. Here is how you can convert pages to images:

Document doc = new Document(MyDir + @"in.docx");
ImageSaveOptions opts = new ImageSaveOptions(SaveFormat.Png);
opts.PageIndex = 0;
opts.PageCount = doc.PageCount;

opts.PageSavingCallback = new HandlePageSavingCallback();
doc.Save(MyDir + @"17.10.png", opts);

private class HandlePageSavingCallback : IPageSavingCallback
{
    public void PageSaving(PageSavingArgs args)
    {
        args.PageFileName = string.Format(MyDir + @"Page_{0}.png", args.PageIndex);
    }
}

Thanks Tahir for your response. With this I can show the final document to user in kind of read only mode.
Currently we were using word API for all processing. Seems that we will need to continue using the same for display of documents to Edit.

@raghvesh,

Thanks for your inquiry. You can modify the Word documents using Aspose.Words. However, we do not provide any user interface to edit document. Please refer to the following article.
Using DocumentBuilder to Modify a Document Easily