Free Support Forum - groupdocs.com

How document viewer works in .NET?

I am trying to test GroupDocs.Viewer with DotNet Core MVC app. The code seems pretty simple and it appears to work but I don’t see any results. I thought this product was a “Viewer”. It seems very simple to use but I’m assuming I’m missing an important step. I’m using the simplest of tests. The following code is called from within a controller.
public IActionResult GetDocs()
{
using (Viewer viewer = new Viewer(@“E:\temp\ODLAZURE-JAN-2020.pdf”))
{
PdfViewOptions viewOptions = new PdfViewOptions();
var test = viewOptions.GetType();
viewer.View(viewOptions);
}
Return View()
}

This code runs. There are no error messages. It just returns my empty razor page.

1 Like

@marlodan19,

Let us elaborate you how API actually works. The core feature of API is to take a source document as input, convert or render it to any of the supported file formats (e.g. HTML, image or PDF).
Now that you have the rendered or converted output, you can display it in browser.

API allows you to load source document from multiple sources (e.g. Amazon S3 storage, Azure Blob, Stream). The rendered or converted output is then saved to the local disk or into a stream.
Once API renders/converts source document and returns output, you can display that output in browser (you have to code it).
We’d recommend you to explore this open-source showcase project and have a look at video demonstration of this project. You can also explore our console application to get an idea how API process input document and generates output. Please let us know if it helps or you have any further query.