Dimensions Not Showing up in PDF

Hello,
I’m attempting to use Aspose.net CAD to convert a dxf file to PDF. The trouble is that my dimension lines are not showing up. I’m using NetDxf to generate the dxf file and using the LinearDimension class from that library. When I open the Dxf file that my code generates, the dimension lines show in CAD as Rotated Dimensions, which I see that Aspose CAD supports. After converting to PDF they do not show up however.

I’m wondering what I’m doing wrong. Attached is a screenshot sample Dxf that my code generates and that I’m trying to convert to a PDF with Aspose.
dim.png (78.5 KB)
Thank you

@kgrems

Can you please share the source DXF file along with generated output and used sample cod for further investigation on our end. I also request you to please try using latest Aspose.CAD for .NET 20.12, if you are using any older version.

Sure, please find the Dxf file attached within the .zip archive.

I also tried uploading this Dxf to one of your online converters and noticed that the dimensions did not show in that output PDF either.

Also attached in the .zip, please find a screenshot indicating that we have version 20.9.1 installed and are only able to upgrade to 20.11.0. I’m not sure how to get it to 20.12 as you describe. We are using NuGet package manager. Dxf and Version Screenshot.zip (40.9 KB)

Finally, here’s the C# code that creates the dimensions that are not showing up once the PDF converts.

public static LinearDimension Measure(Point p1, Point p2, int rotation = 0)
    {
        DimensionStyle style = new DimensionStyle("Default Style");
        style.TextHeight = 2.0;
        style.TextInsideAlign = true;
        style.DimLineLineweight = Lineweight.W15;
        style.TextHorizontalPlacement = DimensionStyleTextHorizontalPlacement.AtExtLines1;
        //AlignedDimension dim = new AlignedDimension(new Vector2(p1.X, p1.Y), new Vector2(p2.X, p2.Y), 2.5, style);
        var dimension = new LinearDimension(new Vector2(p1.X, p1.Y), new Vector2(p2.X, p2.Y), 2.5, rotation, style);
        return dimension;
    }

@kgrems

Can you please share the working example rather only a method for dimension that I may use to add in our issue tracking system for investigation as it seems to be an issue related to API.

Please find a sample application at the link below. It uses the same packages and versions as our production application.

It simply produces a LwPolyline and measures a side of it using a LinearDimension. You’ll see that the original Dxf contains the LwPolyline and LinearDimension, but once converted to PDF using Aspose, the LinearDimension is lost.

You’ll notice that if you upload the generated .Dxf document to an Aspose online converter, the dimension line is omitted as well.

Thank you!

https://www.dropbox.com/s/dagxov861u548qn/TestDxfConversion.zip?dl=0

@kgrems

Appreciate your cooperation and I have created a ticket with ID CADNET-1305 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

Excellent. Thank you!

@kgrems

We expect to resolve this issue in Aspose.CAD for .NET 20.2 and we will share notification with you as soon as the issue will be fixed.

Thanks for the update. Do you have any kind of date for when this will be available? My team would like an ETA.

@kgrems

The concerned issue is in progress at the moment and we request for your patience. We will share the updates with you as soon as the issue will be addressed.

My team is in need of an update on this. We are getting close to our release date and still have no resolution on your end.

@kgrems

The issue has been marked as resolved in upcoming Aspose.CAD for .NET 21.1. We request for your patience and will share notification with you as soon as release will be available online. Please use following sample code with concerned release.

using (CadImage cadImage = (CadImage)Image.Load(fileName))
{

CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();

rasterizationOptions.Layouts = new string[] { "Model" };
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.VectorRasterizationOptions = rasterizationOptions;

cadImage.Save(outPath, pdfOptions);
}

The issues you have found earlier (filed as CADNET-1305) have been fixed in this update.

Hello @kgrems,

I had the same issue and get through by setting in netDXF

dxfDocument.BuildDimensionBlocks = true;

@subGm

Thank you for sharing your suggestion.