Document Viewer .NET API on Mac OS

Hi Support,Screen Shot 2020-06-22 at 9.10.38 PM.jpg (570.6 KB)
Screen Shot 2020-06-22 at 9.11.02 PM.jpg (462.3 KB)

We have been trying to evaluate GroupDocs.Viewer on Visual Studio For Mac 2019, by adding GroupDocs.Viewer (latest stable 20.5.0) via NuGet Package Manager.
I intend to use the GroupDocs .net APIs on macOS.

Here are the issues that I’m facing when trying it in a Mac app:

In VS2019 for Mac: Solution->Target Framework->Xamarin.Mac Modern. In this case, GroupdDocs.Viewer is added successfully via Nuget.
Using your example code I tried the following code:

string documentPath = @“/Users/navneet/Desktop/1.docx”; // word file from Office 365 for windows, same happens when using word file from office 365 for Mac

Console.WriteLine(System.IO.File.Exists(documentPath));// writes True in console

using (Viewer viewer = new Viewer(documentPath))// Fails here with exception thrown, please see details below

{
// The file path format e.g. ‘page_{0}.html’
string filePathFormat = @“/Users/navneet/Desktop/page-{0}.html”; HtmlViewOptions options =

HtmlViewOptions.ForEmbeddedResources(filePathFormat); viewer.View(options);

}

The System.IO.FileNotFoundException is thrown stating the file Aspose.PDF is not found.

Please also refer this link on your forums, where we have same type of issue with Group Docs Conversion. Document conversion API for Mac OS using .NET

To which your response is as follows: “We have logged this issue with ticket ID CONVERSIONNET-3974 for further investigation. As there’s any update, you’ll be notified.”

1 Like

@navn999

We are investigating this scenario. Your investigation ticket ID is VIEWERNET-2540. In case of any update, we’ll notify you.

Hi,
Our issue with conversion API for macOS using .Net was resolved (link: Document conversion API for Mac OS using .NET ). We also need this to be resolved in order to continue with our project.

Please see…

Thanks.
Navneet

@navn999

VIEWERNET-2540 is in progress. We’ll notify you as there’s any update or ETA of fix.

@navn999

We investigated VIEWERNET-2540 and it seems like a Xamarin.Mac issue (extract). Please have a look at this comment.

Since the beginning, Xamarin.Mac and Xamarin.iOS have (unfortunately) required all NuGet packages to be added to the head project. Xamarin.Android, however, does not have this issue: Xamarin.Android can recursively find the closure of all referenced assemblies. We may be unifying this behavior after the .NET 5 timeframe. If you include the missing NuGet packages is the problem solved?

Here is workaround:

  • In the Visual Studio for Mac navigate to the project options → Build → Mac Build → Check all in the Internatiolization section, see codesets.jpg (283.0 KB)
  • Install GroupDocs.Viewer and other required packages see packages.png (416.4 KB)

Try out this sample application - TestViewer.zip (349.0 KB). Let us know in case of any issue.