Free Support Forum - aspose.com

DWF to PDF conversion performance

Hi there,

We are using Aspose.CAD for .NET version 20.3 and use the following code to convert the attached (Corridor-6a.zip (1.0 MB)) DWF input file to PDF:

        using (var image = Image.Load(input))
        {
            var cadPageSizes = CadPageSizesForA4(image.UnitType);
            var rasterizationOptions = new CadRasterizationOptions
            {
                PageWidth = cadPageSizes.PageWidth,
                PageHeight = cadPageSizes.PageHeight,
                UnitType = cadPageSizes.UnitType,
                DrawType = CadDrawTypeMode.UseObjectColor
            };
            image.Save(output, new PdfOptions
            {
                VectorRasterizationOptions = rasterizationOptions
            });
        }

The process takes ~45 seconds and consumes around 2Gb of memory.

Now we understand that this is a CAD file with a lot of items in it but we wanted to know if:

  1. you could look into it and see if there is a problem with the conversion
  2. is there another way to make this conversion process easier (e.g. with some loss on quality for instance).

Best regards.

@gwert,

I have observed the issue shared by you and request you to please share the working VS Solution reproducing the issue on your end along with machine specification and memory profile snapshot. We will be able to investigate the issue further on our end on provision of requested information.

Hi there,

Can you please give this a try and let us know what you see?
We will follow with more data, sure, but this pretty obvious on our side and most likely it will be on your side as well.
The DWF file contains a lot of small items.

Thank you!

@gwert,

I requested you to please share the following information.

I have tried to create a sample project by my self and found following custom call in your code that I am unable to resolve.

        var cadPageSizes = CadPageSizesForA4(image.UnitType);

Hi there,

Here is a full working solution CadToPdf-20-3.zip (1.0 MB) that includes the input file as well.
The CadPageSizesForA4 is just a function based on code that you guys suggested in your free forum or in documentation.

We just want to understand if there is a faster/less consuming way to convert CAD files to PDF. It could involve flattening for what is worth.

Thank you.

@gwert,

Thank you for sharing the information with us. An issue with ID CADNET-1102 has been created in our issue tracking system to further investigate and resolve the issue w.r.t performance aspects. This thread has been linked with the issue so that you may be notified once the issue will be fixed.