Open- change and save of document => possible places for original document corruption?

Hi Aspose team,

I am thinking in which cases I can damage documents that are opened (loaded into memory) using Aspose components.

Is workflow following:

1. I "instruct" that document is opened with Aspose components
This can be also loading into memory stream

Any risk doing so to original document? I would assume not but just to check how this process works.

2. I search for some string and make replacement
I would say no risk for original document as changes are done only in memory, original document after opening is not touched anymore, right?

3. Save where original document is overwritten
Possible risk as document is overwritten (in case that there is corruption of stream).

Thanks,
Oliver

Hi Oliver,

1. When you load a document using Aspose APIs, an instance of your original document is created in memory however it will not change or effect your original document. All changes are done in memory and will not be saved until you call Save method to save the document.

2. Yes, you are right. No changes are made to original document because changes are in memory and not saved yet. It is up to you if you want to save the changes to a new document or replace existing document with the new one.

3. When you open a document and save updated document to the same location and with the same name, your original document will be replaced with the new one. If the new stream is corrupt, you will see the corrupted document in this case.

Best Regards,