Free Support Forum -

Convert IGES to PDF: What to class to use when loading image file? CadImage or Image?

When loading IGES files, in the sample code, it uses CadImage class.
But it produce exceptions.

When loading IGES files, using Image.
I encounter no problem.

Is this only for IGES files?
Because for STL, DXF, and DWG, using CadImage class has no problem.

Attached is sample IGES file. (224.9 KB)

Below is sample code that produce the exception:

public class ExportIGEStoPDF {

public static void main(String[] args)
    String dataDir = Utils.getDataDir(ExportIGEStoPDF.class) + "IGESDrawings\\";
    String PLTPathToFile = dataDir + "PenAssy.igs";
    CadImage image = (CadImage)Image.load(PLTPathToFile);
    //Setting PDF Options
    PdfOptions pdfOptions = new PdfOptions();
    CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions();
    //Saving to PDF"figa2.pdf", pdfOptions);



Actually, Image is parent class for both CadImage and IgesImage classes. Therefore, you can use Image or IgesImage class for IGES files.

1 Like