Aspose.Total for .Net questions

I am Testing Aspose.Total for .Net and have a few questions. The first question is does a file have to be stored to the hard drive or can it just be stored in the memory? Second question is when you extract text from a file is there any way to extract everything from a document and have it put into a stream of text? Third question is when you have many differnt files open and you save them do you need a new file name and do I need to close the files out? Thank you.

This message was posted using Email2Forum by haley.stuart.

Hi,
Please specify which file management product(s) you’re talking about. In general,

  1. You can use MemoryStream or data retrieved from memorystream to store data in memory
  2. Please let us know how you were planning to put “everything” into stream of text (i.e. were you talking about text only or also graphics/images etc)
  3. Please be more specific about your needs here. When you need to save a file, you obviously need a file name. Was your question about being able to modify files, which are opened by other sofware ? Please clarify.
  1. All I needed to have done is dig a little and try it on my own to find out. Sorry to bother needlessly.
  2. If I have the following file opened:
    Aspose.Words.Document theDoc = new Aspose.Words.Document(fileName);
    My question should have been if I can use theDoc.toTxt() to get the contents of the entire file as a string of text, or, if there is a different way to accomplish the task, what the process would be?
  3. Assume I have 100 files to process. I have the names of the files to process in an array and would like to loop through the array and process each file, in turn. If I’m in a loop, do I need to “close” the file in order to release any handle on the file, or do I simply need to reassign the file object, as in:
Aspose.Words.Document theDoc;
foreach(String fileName in arrFilesToProcess){
     theDoc = new Aspose.Words.Document(fileName);
     // do my processing
     theDoc.Save();
}

Hi
Thanks for your inquiry.

  1. Yes of course you can save document in memory. Please see the following link to learn how to achieve this.
    https://reference.aspose.com/words/net/aspose.words/document/save/
  2. Please see the following link to learn how to extract text from the document.
    https://docs.aspose.com/words/net/how-to-extract-selected-content-between-nodes-in-a-document/
  3. No, you don’t need to close document.

Best regards.