1

I am trying to load a .dwg file to convert from cad to pdf using below code:

using (var image = Aspose.CAD.Image.Load("fileName.dwg"))
{
    // process the drawing
}

But .dwg file is not being load by above code. It takes so much time for loading but nothing happens and process continues without any end.(I have uploaded file of 212 MB and waited for more than 1 hour). Please let me know how I can load file using Aspose.CAD.Image.Load

Note: I am using this code and process in asp.net webforms.

Piyush
  • 21
  • 1
  • 9
  • Check memory usage in Task Manager. The Aspose must be using a lot of memory and then when you try to load a large file you are using swap space which is very slow. – jdweng Oct 22 '20 at 10:49
  • I have checked with task manager and it shows 69% memory is used when i debug in visual studio. @jdweng – Piyush Oct 22 '20 at 13:48
  • Is that before, during, after the 212MB file loaded? What is your total memory on machine? what is the CPU usage? If you make a copy of the dwg how long does it take to copy. Right now I don't know if the issue is the reading of the file, the CPU processing, or the memory. Trying to get a better idea. Copying the file will give better idea. Check the available space on disk. I've seen issues like this when the disk get badly fragmented or a corrupted file. – jdweng Oct 22 '20 at 15:21
  • Everything is working fine and I am able to copy paste file within 4-5 second but somehow it takes more time to load programmatically – Piyush Oct 26 '20 at 06:13
  • It is possible this is an encoding issue. Your read method could be filtering characters. So your read method is hanging up due to some character(s) in the file (or missing). If you are reading the file as ASCII is could be removing characters (non printable) that are need while the copy and paste is reading all the characters – jdweng Oct 26 '20 at 08:20
  • Yes, it has drawing of so many objects and which are needed to be print on webpage. I am using Aspose.CAD.Image.Load() function to print all objects from file to webpage but somehow this function is taking unexpected load time.Any idea how to solve this ? – Piyush Oct 26 '20 at 10:05
  • The issue is not the opening. The issue is the processing that Aspose is performing. Are you using latest version 20.9? Version 20.6 has known issue. See : https://docs.aspose.com/cad/java/aspose-cad-for-java-20-6-release-notes/ – jdweng Oct 26 '20 at 10:57
  • Yes, I am using latest version(20.9.1) of nuget package in my application. – Piyush Oct 27 '20 at 08:52
  • Looks like the same issue is with 20.9. It is issue : CADJAVA-737 – jdweng Oct 27 '20 at 09:29

2 Answers2

0
  1. Update the nuggets to the latest version (currently : 22.4.0)
  2. Converting larger dwg files to png or jpg takes a long time, instead convert it to pdf first (can take 15sec) then convert the pdf file to png or jpg file.
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Dzhan
  • 1
0

If you could share your file with us we might look why it loads so slowly or, probably, hanging at load. You can also use our official forum https://forum.aspose.com/c/cad/19 so we can provide instant response.

Disclosure: I work as Aspose.CAD developer at Aspose.