The problem of java api download

I tried to obtain the Java API through the Maven settings provided at Aspose.CAD Java 24.4 | CAD and BIM Processing Conversion Java API SDK, but I was unable to do so, so I am reaching out for assistance.
How can I test the Java API?
Additionally, do I need a license for the free trial?

@caos96

Can you please specify what issues you encountered while trying to download the Java API through Maven? Also, are you asking about testing the API functionality or the installation process?

The library is not downloading from Maven. If the installation succeeds, I want to check the feasibility of adoption through a sample program, but I haven’t been able to install it yet, so I haven’t been able to do that.

@caos96,
Hello.
Just tested the pom.xml sample and see no issues with Maven. Please share the error you observe on your side. You can download the library directly also here (please see Package Explorer tab) or by your reference above (please look at Versions tab). You can obtain free evaluation license via Temporary License - Purchase - aspose.com to unlock all features of the product, or you can use it without license with limitations (watermark will appear, only 100 of entities are available to process with API).

thank you! have a nice day~

1 Like

@caos96,
thank you, same to you :slight_smile:

What should I do if the following error occurs?

Exception in thread “main” java.lang.VerifyError: Illegal type at constant pool entry 64 in class com.aspose.cad.internal.gK.dC
Exception Details:
Location:
com/aspose/cad/internal/gK/dC.(Lcom/aspose/cad/internal/gK/ii;)V @27: invokestatic
Reason:
Constant pool index 64 is invalid
Bytecode:
0x0000000: 2ab7 003f 2a2b b500 182a bb00 1359 2ab4
0x0000010: 0018 b700 37b6 003c b200 1cb8 0040 b900
0x0000020: 4202 00b2 001d b900 4102 00b2 001e b900
0x0000030: 4302 00c0 0002 b500 19b1

    at com.aspose.cad.internal.gK.ii.d(Unknown Source)
    at com.aspose.cad.internal.gK.ay.e(Unknown Source)
    at com.aspose.cad.internal.gK.ay.a(Unknown Source)
    at com.aspose.cad.internal.hf.n.a(Unknown Source)
    at com.aspose.cad.internal.gI.i.a(Unknown Source)
    at com.aspose.cad.internal.gI.bY.a(Unknown Source)
    at com.aspose.cad.internal.gI.bW.a(Unknown Source)
    at com.aspose.cad.Image.a(Unknown Source)
    at com.aspose.cad.Image.load(Unknown Source)
    at TEST.main(TEST.java:16)

TEST code

import com.aspose.cad.Image;
import com.aspose.cad.Rectangle;
import com.aspose.cad.fileformats.cad.CadImage;
import com.aspose.cad.imageoptions.CadRasterizationOptions;
import com.aspose.cad.imageoptions.JpegOptions;

public class TEST {

public static void main(String[] args)
{
	 String sourceFilePath = "C:\\eclipse_xupN\\workspace\\aaa\\blocks_and_tables_-_metric.dwg";
        String outputFilePath = "C:\\eclipse_xupN\\workspace\\aaa\\zoomed_output.jpg";
        
        // CAD 이미지 로드
        CadImage cadImage = (CadImage) Image.load(sourceFilePath);
        
        // 전체 길이가 100인 도면에서 왼쪽 50 영역 확대
        double totalLength = 100.0;
        double zoomedLength = 50.0; // 확대할 영역의 길이
        
        // 확대할 영역 설정
        Rectangle zoomedArea = new Rectangle(0, 0, (int) zoomedLength, cadImage.getSize().getHeight());
        
        // CAD 래스터화 옵션 설정
        CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
        rasterizationOptions.setPageWidth(1000); // 출력 이미지의 가로 크기
        rasterizationOptions.setPageHeight(500); // 출력 이미지의 세로 크기

// rasterizationOptions.setCenterDrawing(true); // 도면을 중앙에 정렬
// rasterizationOptions.setBounds(zoomedArea); // 확대할 영역 지정

        // 이미지 옵션 설정
        JpegOptions jpegOptions = new JpegOptions();
        jpegOptions.setVectorRasterizationOptions(rasterizationOptions);
        
        // CAD 이미지를 확대된 영역으로 이미지로 저장
        cadImage.save(outputFilePath, jpegOptions);
        
        System.out.println("확대된 영역이 이미지로 저장되었습니다: " + outputFilePath);
        
        // 화면에서 보이는 길이 계산
        double scaleFactor = 1.0; // 확대 배율
        double visibleLength = zoomedLength * scaleFactor;
        
        System.out.println("화면에서 보이는 길이: " + visibleLength + " 단위");
}

}

@caos96,
please share the initial file so we can reproduce this issue.

TEST.zip (306.0 KB)

DWF and DWG, along with a Java file, are attached.

Thank you.

am also facing this issue , just load image throws , any fix for this?

Could you please upload a DWG or DWF file that works?

@snazeer, @caos96,
could you please check if switching to previous versions 24.3 or 24.2 resolves the issue?

wow! 24.2 work fine!
Thank you~!

@caos96,
and what about 24.3? Does it fail there?

24.3 alose fine~

@caos96,
could you please share what is your IDE? We have created CADJAVA-11697 to investigate this case.

https://www.autodesk.com/support/technical/article/caas/tsarticles/ts/6XGQklp3ZcBFqljLPjrnQ9.html i got the files at this url.

1 Like

@caos96,
got it, thank you.