DXF
JPG
PDF
XML
DWF
DXF
通过 Java 将 DWF 转换为 DXF
无需 Adobe 即可读取、写入和导出 DWF 到 DXF 的本机 Java 库。
如何使用 Java 将 DWF 转换为 DXF
为了将 DWF 渲染为 DXF,我们将使用 Aspose.CAD for Java API,这是一个功能丰富、强大且简单的 API使用 Java 平台的转换 API。您可以直接从 Maven 下载其最新版本和通过将以下配置添加到 pom.xml 中,将其安装在基于 Maven 的项目中。
存储库
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
依赖
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-cad</artifactId>
<version>version of aspose-cad API</version>
<classifier>jdk17</classifier>
</dependency>
通过 Java 将 DWF 转换为 DXF 的步骤
- 用Image.load方法加载DWF文件
- 设置页面高度和宽度的CadRasterizationOptions对象
- 创建 DxfOptions 类的实例并设置其 VectorRasterizationOptions 属性
- 调用 Image.save 方法,同时传递 DxfOptions 的结果文件路径和对象
转换要求
- 适用于 JSP/JSF 应用程序和桌面应用程序的 Microsoft Windows 或具有 Java 运行时环境的兼容操作系统。 - 直接从 Maven 获取最新版本的 Aspose.CAD for Java。DWF 到 DXF Java 转换源代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// load DWF in an instance of Image via its Load method | |
Image image = Image.load("template.dwf"); | |
// create an instance of CadRasterizationOptions and set page height & width | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); | |
rasterizationOptions.setPageWidth(1600); | |
rasterizationOptions.setPageHeight(1600); | |
// create an instance of DxfOptions | |
TiffOptions options = new TiffOptions(); | |
// set the VectorRasterizationOptions property as CadRasterizationOptions | |
options.setVectorRasterizationOptions(rasterizationOptions); | |
// export DWF to DXF | |
image.save("output.dxf", options); |
将 DWF 转换为 DXF 的免费应用程序
Convert DWF to DXF right now by visiting our Live Demos website.The live demo has the following benefits
No need to download Aspose API.
No need to write any code.
Just upload your DWF file, it will be converted instantly to DXF.
You will get the download link.