CAD file zoomed out WAY too far

Hi

We are using groupdocs viewer for .NET (16.10.0.0). When we tried to view the attached "DWG" file, the viewer is zoomed out way too far. It looks as if nothing opens, but if the user zooms in or scrolls down, then we can eventually see the drawing.

We downloaded the solution from GitHub (https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET) - Version 17.2.0.0 and tried the file in that solution also. In that solution we are not able to view the picture in HTML mode. But we are able to view the drawing in image mode. Here also we found that the drawing is too small in view.

Is there any option to fit the drawing in the window without all the blank space.

We attached a zip file which includes the dwg file and swf video which shows the issue.

Hi there,


Thanks for using GroupDocs.Viewer for .NET.

We shall investigate your reported issue and share the outcomes with you shortly. Please stay tuned with us.

Have a nice weekend ahead.
Warm Regards

Hi there,


Thanks for your cooperation.

We have tested your provided .dwg file in ASP.NET MVC Front End showcase project and found that .dwg file is not loading in HTML file. Therefore, we’ve logged this issue in GitHub issues as https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET/issues/119. We shall look into it and in case of any updates we’ll notify you. You can also keep track of the above mentioned link for further updates.

Furthermore, we are currently working to check if there is any workaround to get rid of the blank area around the drawing image. We’ll get back to you after we have some updates. We appreciate your patience and cooperation.

Warm Regards

Any update on this issue?

Hi There,


We have been working on this issue but we can not share any ETA at the moment. However, we can suggest you a temporary solution (as written below).

Please inject the style(as written in step 1) into html.

1- Create the string variable “styleText” and assign the below style to that variable.

body {
display: flex;
justify-content: center;
height: 600px; /* or other desired height */
overflow: hidden;
align-items: center;
}
img {
flex: none;

}

2- Use the following code with the version 17.3.0 to inject the style

ViewerConfig config = new ViewerConfig();
config.StoragePath = @“C:\storage”;
config.UseCache = true;

ViewerHtmlHandler handler = new ViewerHtmlHandler(config);
HtmlOptions options = new HtmlOptions();
options.IsResourcesEmbedded = false;

List pages = handler.GetPages(sourceFileName, options);
string html = pages[0].HtmlContent;
int index = html.IndexOf("");
html = html.Insert(index, styleText);
// Save html string as an html file


Please have a try and share your feedback.

Many thanks

@rbrous

The issue you have found earlier related to CAD files (filed as VIEWERNET-1128) has been fixed in this update. Furthermore, you can use responsive rendering in case you want better output across different devices. For more details on responsive output, please visit this article.