Memory Usage

Hi,

i have been testing around converting dwg to pdf, and i would like to get more information about some details.

I have noticed some DWG takes longer than i was expecting, and also big memory usage. For example, one of the DWG files i am converting has 6mb, and the generated PDF has 25mb. The java code is only able to process that if i set the jvm to -Xms2048m, and it takes at least 1 minute. My code is based on the sample on your page “Convert DWG file to PDF”.

1. Do you have recommendations about memory usage?

2. I am not sure why the generated pdf is 5x bigger than the dwg file. Is it generating a vectorial pdf? If so, is it possible to generate a lower quality/non-vectorial pdf?

3. Some of my dwg files have references to external images that are located in the same directory. Is it possible to tell the converter to include them in the generated pdf?

Thank you.

Regards,
morigi

Hi Morigi,

Thank you for your inquiry.

This is to update you that we need the sample file that you are using at your end to regenerate the issue at our end. Please send us the sample file for further investigation.

There are 2 different ways in which Aspose.CAD converts the drawing to PDF format.

  1. Rasterization
  2. Vector

While converting CAD drawing to PDF we use CadRasterizationOptions. CadRasterizationOptions has a property called ContentAsBitmap. In case this property is set to true raster image will be generated in result. In case it is not set as true then generated PDF will be vector PDF. Please note that by default it is set as false hence generate vector PDF.

Furthermore there are no strict requirements for Aspose.CAD APIs to execute. You may use core i3 with 2GB of RAM.

Hope the above information helps. Feel free to contact us in case of any query or comments.

Hi,

thank you for your answer. I already tested using the “setContentAsBitmap” as true. The resulting pdf is around 200kb instead of 25mb, so it seems to be pixelized instead of vectorial, but it takes more than 10 minutes to generate the pdf…

I attached the dwg file that i am using. Let me know if there is a specific reason why this file takes so much time to be generated into pdf format.

Thank you,
morigi

Hi Morigi,

Thank you for your inquiry and sharing sample.

We have tried to regenerate the issue at our end by using the sample provided by you. We are able to generate the PDF file in time:

total time: 1 minute 31 seconds.

We have used VM settings as -Xms2048m. The DWG file provided by you is a very complex drawing. If we do not provide extra memory then it will through “out of memory” exception.