Good afternoon! I have an issue: when I try to convert an IGS file to PDF using Aspose.CAD for .NET, I only get an empty PDF with both height and width equal to int.minimum. Does anyone know what might be causing this problem?
image.png (117.7 KB)
Summary
You are seeing an empty PDF whose page dimensions are reported as int.MinValue when converting an IGES (.igs) file with Aspose.CAD for .NET. This usually means the SDK could not determine the drawing’s extents, so it falls back to an undefined size.
Why it happens
- The IGES file may not contain valid bounding‑box information, or the geometry could be corrupted, causing Aspose.CAD to be unable to calculate the model limits.
- When the SDK cannot obtain extents, the auto‑sizing logic may produce a page size of
Int32.MinValuefor both width and height, resulting in an empty PDF.
What to do next
- Validate the IGES file – Open it in a standard CAD viewer (e.g., FreeCAD, Autodesk Viewer) to confirm the geometry is displayed correctly. If the viewer also shows nothing, obtain a clean copy of the file.
- Specify explicit page dimensions when saving to PDF. Example:
using Aspose.CAD;
using Aspose.CAD.ImageOptions;
using System.Drawing;
using (var cadImage = (CadImage)Image.Load(@"C:\input.igs"))
{
var rasterOptions = new CadRasterizationOptions
{
PageWidth = 1200, // pixels
PageHeight = 1600, // pixels
Layout = CadLayoutType.ModelSpace,
DrawType = CadDrawType.Wireframe,
BackgroundColor = Color.White,
Scale = 1.0
};
var pdfOptions = new PdfOptions { VectorRasterizationOptions = rasterOptions };
cadImage.Save(@"C:\output.pdf", pdfOptions);
}
Adjust PageWidth, PageHeight, or Scale to suit your model.
3. Update Aspose.CAD – Ensure you are using the latest NuGet package; newer versions improve extent detection and add support for more IGES entities.
4. Check licensing – Load a valid license before conversion to avoid any evaluation‑mode restrictions.
5. If the problem persists – Consider converting the IGES to an intermediate format (e.g., DWG) with another tool, then convert that file with Aspose.CAD, or contact Aspose support with the problematic file for further analysis.
Note: The provided evidence only confirms the existence of Aspose.CAD for .NET documentation but does not contain specific details about the int.MinValue issue. The steps above are based on typical troubleshooting practices for this SDK.
I could not fully verify this explanation against the retrieved sources. Please double-check the behaviour in your environment and confirm the exact SDK/version.
@Professionalize.Discourse I tried opening this file in CAD, and the 3D model displays without any problems. I also tried setting arbitrary values for height and width, but I just get an empty PDF.
@AndrewMorgun,
Hi,
could you please attach here the initial file and conversion code, so we can reproduce this issue directly?