Can FODG or SVG files be converted to DWG files using Aspose.CAD? How can I apply for a trial version? Thank you

Can FODG or SVG files be converted to DWG files using Aspose.CAD? How can I apply for a trial version? Thank you.

@wang1231

Aspose.CAD does not explicitly mention the capability to convert FODG or SVG files to DWG files in the provided documentation. However, Aspose.CAD is primarily designed for handling CAD files, and it supports various operations on DWG files, including importing images into them.

For your second question, you can apply for a free trial of Aspose.CAD. The trial version allows you to explore the features of the library. You can find more information and apply for the trial here.

If you need further assistance or have specific requirements regarding file conversions, I recommend checking the Aspose community forums for additional insights or similar queries.

Sources:
[1]: Importing Images into DWG Files with C# - Aspose.CAD Guide

@wang1231,
Hi.
Aspose.CAD has no support for ODG/FODG, but it looks like Aspose.Imaging has or functinality of products could be combined.
Here is short example how to convert SVG to DWG:

using (SvgImage svgImage = (SvgImage)Aspose.CAD.Image.Load(fileName))
{
	svgImage.Save(outPath, new DwgOptions());
}

You can get free evaluation license in Purchase Portal. Please add the products to the cart, view it, click “Proceed” and “Get a Temporary License” next.

Thank you. For the trial license, is it necessary to register an account using a corporate email?

@wang1231,
yes, you need to use corporate account.

Thank you, I have obtained a trial license. Are there any version requirements for the jar package, or is the general aspose-cad.jar package sufficient as long as I have the trial license?

@wang1231,
There are no version requirements, you can find additional information here, and you can also ask questions on this topic in our Purchase forum branch.

报了这些错误。“C:\Program Files\Java\jdk-17\bin\java.exe” “-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2021.1\lib\idea_rt.jar=60430:D:\Program Files\JetBrains\IntelliJ IDEA 2021.1\bin” -Dfile.encoding=UTF-8 -classpath D:\automate-backend\target\classes;D:.m2\repository\org\springframework\boot\spring-boot-starter-web\2.7.18\spring-boot-starter-web-2.7.18.jar;D:.m2\repository\org\springframework\boot\spring-boot-starter\2.7.18\spring-boot-starter-2.7.18.jar;D:.m2\repository\org\springframework\boot\spring-boot\2.7.18\spring-boot-2.7.18.jar;D:.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.7.18\spring-boot-autoconfigure-2.7.18.jar;D:.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.7.18\spring-boot-starter-logging-2.7.18.jar;D:.m2\repository\ch\qos\logback\logback-classic\1.2.12\logback-classic-1.2.12.jar;D:.m2\repository\ch\qos\logback\logback-core\1.2.12\logback-core-1.2.12.jar;D:.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.17.2\log4j-to-slf4j-2.17.2.jar;D:.m2\repository\org\apache\logging\log4j\log4j-api\2.17.2\log4j-api-2.17.2.jar;D:.m2\repository\org\slf4j\jul-to-slf4j\1.7.36\jul-to-slf4j-1.7.36.jar;D:.m2\repository\jakarta\annotation\jakarta.annotation-api\1.3.5\jakarta.annotation-api-1.3.5.jar;D:.m2\repository\org\yaml\snakeyaml\1.30\snakeyaml-1.30.jar;D:.m2\repository\org\springframework\boot\spring-boot-starter-json\2.7.18\spring-boot-starter-json-2.7.18.jar;D:.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.13.5\jackson-datatype-jdk8-2.13.5.jar;D:.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.13.5\jackson-datatype-jsr310-2.13.5.jar;D:.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.13.5\jackson-module-parameter-names-2.13.5.jar;D:.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.7.18\spring-boot-starter-tomcat-2.7.18.jar;D:.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.83\tomcat-embed-core-9.0.83.jar;D:.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.83\tomcat-embed-websocket-9.0.83.jar;D:.m2\repository\org\springframework\spring-web\5.3.31\spring-web-5.3.31.jar;D:.m2\repository\org\springframework\spring-beans\5.3.31\spring-beans-5.3.31.jar;D:.m2\repository\org\springframework\spring-webmvc\5.3.31\spring-webmvc-5.3.31.jar;D:.m2\repository\org\springframework\spring-aop\5.3.31\spring-aop-5.3.31.jar;D:.m2\repository\org\springframework\spring-context\5.3.31\spring-context-5.3.31.jar;D:.m2\repository\org\springframework\spring-expression\5.3.31\spring-expression-5.3.31.jar;D:.m2\repository\org\springframework\boot\spring-boot-starter-validation\2.7.18\spring-boot-starter-validation-2.7.18.jar;D:.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.83\tomcat-embed-el-9.0.83.jar;D:.m2\repository\org\hibernate\validator\hibernate-validator\6.2.5.Final\hibernate-validator-6.2.5.Final.jar;D:.m2\repository\jakarta\validation\jakarta.validation-api\2.0.2\jakarta.validation-api-2.0.2.jar;D:.m2\repository\org\jboss\logging\jboss-logging\3.4.3.Final\jboss-logging-3.4.3.Final.jar;D:.m2\repository\com\fasterxml\classmate\1.5.1\classmate-1.5.1.jar;D:.m2\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:.m2\repository\org\springframework\spring-core\5.3.31\spring-core-5.3.31.jar;D:.m2\repository\org\springframework\spring-jcl\5.3.31\spring-jcl-5.3.31.jar;D:.m2\repository\org\springframework\boot\spring-boot-configuration-processor\2.7.18\spring-boot-configuration-processor-2.7.18.jar;D:.m2\repository\org\projectlombok\lombok\1.18.30\lombok-1.18.30.jar;D:.m2\repository\org\springframework\boot\spring-boot-starter-thymeleaf\2.7.18\spring-boot-starter-thymeleaf-2.7.18.jar;D:.m2\repository\org\thymeleaf\thymeleaf-spring5\3.0.15.RELEASE\thymeleaf-spring5-3.0.15.RELEASE.jar;D:.m2\repository\org\thymeleaf\thymeleaf\3.0.15.RELEASE\thymeleaf-3.0.15.RELEASE.jar;D:.m2\repository\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;D:.m2\repository\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;D:.m2\repository\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;D:.m2\repository\commons-fileupload\commons-fileupload\1.4\commons-fileupload-1.4.jar;D:.m2\repository\commons-io\commons-io\2.2\commons-io-2.2.jar;D:.m2\repository\cn\hutool\hutool-all\5.8.3\hutool-all-5.8.3.jar;D:.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.13.1\jackson-databind-2.13.1.jar;D:.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.13.5\jackson-annotations-2.13.5.jar;D:.m2\repository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.3\jaxb-runtime-2.3.3.jar;D:.m2\repository\org\glassfish\jaxb\txw2\2.3.9\txw2-2.3.9.jar;D:.m2\repository\com\sun\istack\istack-commons-runtime\3.0.11\istack-commons-runtime-3.0.11.jar;D:.m2\repository\com\sun\activation\jakarta.activation\1.2.2\jakarta.activation-1.2.2.jar;D:.m2\repository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:.m2\repository\com\fasterxml\jackson\core\jackson-core\2.13.1\jackson-core-2.13.1.jar;D:.m2\repository\org\apache\pdfbox\pdfbox\2.0.24\pdfbox-2.0.24.jar;D:.m2\repository\org\apache\pdfbox\fontbox\2.0.24\fontbox-2.0.24.jar;D:.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;D:.m2\repository\com\aspose\aspose-cad\24.6.1\aspose-cad-24.6.1.jar com.leyard.tuzhi.utils.SvgToDwgConverterDEMO
Aspose.CAD 许可证设置成功。
class com.aspose.cad.internal.Exceptions.InvalidOperationException
com.aspose.cad.internal.b.e.a(Unknown Source)
com.aspose.cad.Image.b(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
at com.aspose.cad.internal.b.e.a(Unknown Source)
at com.aspose.cad.Image.b(Unknown Source)
at com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
at com.aspose.cad.Image.save(Unknown Source)
at com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
转换过程中发生错误: Image saving failed.
class com.aspose.cad.cadexceptions.ImageSaveException: Image saving failed. —> class com.aspose.cad.cadexceptions.ImageSaveException: Image export failed. —> class com.aspose.cad.internal.Exceptions.InvalidOperationException
com.aspose.cad.internal.b.e.a(Unknown Source)
com.aspose.cad.Image.b(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
— End of inner exception stack trace —
com.aspose.cad.Image.b(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
— End of inner exception stack trace —
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
at com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
at com.aspose.cad.Image.save(Unknown Source)
at com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
Caused by: class com.aspose.cad.cadexceptions.ImageSaveException: Image export failed. —> class com.aspose.cad.internal.Exceptions.InvalidOperationException
com.aspose.cad.internal.b.e.a(Unknown Source)
com.aspose.cad.Image.b(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
— End of inner exception stack trace —
com.aspose.cad.Image.b(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
at com.aspose.cad.Image.b(Unknown Source)
… 3 more
Caused by: class com.aspose.cad.internal.Exceptions.InvalidOperationException
com.aspose.cad.internal.b.e.a(Unknown Source)
com.aspose.cad.Image.b(Unknown Source)
com.aspose.cad.Image.saveInternal_internalized(Unknown Source)
com.aspose.cad.Image.save(Unknown Source)
com.leyard.tuzhi.utils.SvgToDwgConverterDEMO.main(SvgToDwgConverterDEMO.java:21)
at com.aspose.cad.internal.b.e.a(Unknown Source)
… 4 more

Process finished with exit code 0

package com.leyard.tuzhi.utils;

import com.aspose.cad.Image;
import com.aspose.cad.License;
import com.aspose.cad.imageoptions.DwgOptions;

public class SvgToDwgConverterDEMO {
public static void main(String[] args) {
// 第一步:设置许可证
setLicense();

    // 第二步:定义输入 SVG 文件路径和输出 DWG 文件路径
    String inputSvgFile = "C:\\input.svg";
    String outputDwgFile = "D:\\output.dwg";

    // 第三步:执行转换
    try {
        // 加载 SVG 文件
        Image image = Image.load(inputSvgFile);
        // 保存为 DWG 文件
        image.save(outputDwgFile, new DwgOptions());

        System.out.println("SVG 文件已成功转换为 DWG 文件:" + outputDwgFile);
    } catch (Exception e) {
        System.err.println("转换过程中发生错误: " + e.getMessage());
        e.printStackTrace();
    }
}

/**
 * 设置 Aspose.CAD 许可证
 */
private static void setLicense() {
    License license = new License();
    try {
        // 方式一:从文件系统加载许可证
        // 请确保许可证文件路径正确
        license.setLicense("src/main/resources/Aspose.CADforJava.lic");

        // 方式二:从类路径加载许可证(推荐)
        // 确保许可证文件位于类路径中,例如 src/main/resources/licenses/
        // license.setLicense("Aspose.CADforJava.lic");

        System.out.println("Aspose.CAD 许可证设置成功。");
    } catch (Exception e) {
        System.err.println("设置许可证时发生错误: " + e.getMessage());
        System.err.println("程序将以试用模式运行,生成的文件可能会包含水印。");
        // 根据需要处理异常,例如终止程序或继续运行
    }
}

}
input.zip (11.6 KB)

The version of the JAR package being used is 24.6.1.

@Liyade888,
we can confirm the issue unfortunately, we have created CADJAVA-11755 to fix it.