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.