Unable to view changes made in the document

Hi Team,

I have uploaded a word document and opened it in the GroupDocs.Viewer…
it works good.

I have made some changes in the same document again I uploaded.
Now, I’m unable to view the recently made changes in the viewer.

Please suggest…

Thanks,
Ravi Teja

The below is my code:


using (FileStream fileStream = new FileStream(Server.MapPath("~/UploadFiles/" + filename), FileMode.Open))
{
groupdocsViewerScript = Viewer.ClientCode()
.TargetElementSelector("#viewer")
.Stream(fileStream, filename, extension, filename, true, null)
//.Url("http://www.ewh.ieee.org/tc/its/SOLI08/sample.doc")
.Watermark(“Hello world”,System.Drawing.Color.Black,WatermarkPosition.BottomLeft,9f,false)
.EnableRightClickMenu(true)
.ShowThumbnails(true)
.OpenThumbnails(false)
.Quality(100)
.EnableRightClickMenu(false)
//.ZoomToFitHeight(true)
//.ZoomToFitWidth(true)
.BackgroundColor("#82DDD4")
.ShowZoom(true)
.ShowFolderBrowser(false)
.ShowViewerStyleControl(true)
.ShowSearch(true)
//.PreloadPagesCount(5,true,true)
.Locale(SupportedLocales.esES)
.SupportTextSelection(true)
.UsePdfPrinting(true)
.ShowDownloadErrorsInPopup(true)
.EnableStandardErrorHandling(true)
.UseHtmlBasedEngine(true)
.SearchHighlightColor("#FFDA1C", #FFDA1C)
.DownloadPdfFileIfPossible(true)
.SupportPageReordering(true)
.ToString();
}
return groupdocsViewerScript;

Hello Ravi,

The actual behaviour, when you don't see changes, which were applied to the document, and when using your source code, is correct. There are two ways to fix it:

1. In the ".Stream" method set the "useCachedStreamContentsIfPossible" parameter value to "false": .Stream(fileStream, filename, extension, filename, false, null)
2. Don't use streams and use files using the ".FilePath" method: .FilePath(Server.MapPath("~/UploadFiles/") + filename)

All of these things in detail here: "How to Use GroupDocs.Viewer with Streams in ASP.NET MVC or WebForms Projects", section "Streams and Cache".

If you will have more questions please feel free to contact us.

Thanks for your response,

I tried out with with false

.Stream(fileStream, filename, extension, filename, false, null)

but no change in the viewer , please find my code files in attached documents
for more information…

Thanks,
Ravi Teja

Hello,


We are sorry to hear that you have such issue. Please try to clear cach of the Viewer, delete the “Temp” folder from the root storage of the documents (the folder which you set for Viewer.SetRootStoragePath).

In case that you use stream it loads old document because the stream is generated from it, to update document in the viewer you should update the stream (regenerate it), also you can try to use .FilePath(fileName) instead .Stream since this variant will load updated document each time.