Free Support Forum - groupdocs.com

GroupDocs.Viewer - Displaying Image Error

I’m trialing GroupDocs.Viewer and included it in a sample project. I included the DLL in the project and when trying to render an image in the Viewer, I receive the below error message. Do all the Aspose DLLs need to be included in the project? Should they be included in the GroupDocs.Viewer project?

# System.TypeLoadException
## Could not load file or assembly 'Aspose.Imaging, Version=21.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56' or one of its dependencies.
**Description:** HTTP 500.Error processing request.
**Details:** Non-web exception. Exception origin (name of application or object): GroupDocs.Viewer.

@rcabrera

You don’t need to include any of the Aspose DLLs into project as they are already embedded into GroupDocs.Viewer DLL. Could you please share a sample application or details about the app you’re running and your environment?

Here is the basic code. I’m trying to load a PNG image into the viewer. The goal is to load an image via a Base64 screen and add a signature overlay based on coordinates.

@using GroupDocs.Viewer
@using GroupDocs.Viewer.Options
@{
ViewBag.Title = “Home Page”;
}

@using (Viewer viewer = new Viewer("docs/output.png")) { PngViewOptions viewOptions = new PngViewOptions(); viewer.View(viewOptions); }

@rcabrera

As I can see it’s ASP.NET (Core) MVC application and it looks like you’re trying to use Viewer as a UI-component. In-general GroupDocs.Viewer is a converter to one of the output formats HTML/PNG/JPG/PDF and when you’re trying to run the following code

@using (Viewer viewer = new Viewer("docs/output.png")) { PngViewOptions viewOptions = new PngViewOptions(); viewer.View(viewOptions); }

we’ll read docs/output.png file and convert it to PNG. The output PNG will be placed in the current directory. See the following image as a demonstration
I’m using this sample_app.zip (1.7 MB).

Unfortunately, GroupDocs.Viewer does not support adding signatures. In case you’re looking for the solution to add signatures to the documents GroupDocs.Signature could be a better option as it is focused on adding signatures to documents.