PNG
JPG
PDF
XML
DXF
PNG
แปลง DXF เป็น PNG ผ่าน Java
Native Java Library สำหรับอ่าน เขียน และส่งออก DXF เป็น PNG โดยไม่ต้องใช้ Adobe
วิธีแปลง DXF เป็น PNG โดยใช้ Java
ในการแสดง DXF เป็น PNG เราจะใช้ API ของ Aspose.CAD for Java ซึ่งเป็นคุณลักษณะที่หลากหลาย มีประสิทธิภาพ และใช้งานง่าย เพื่อใช้ Conversion API สำหรับแพลตฟอร์ม Java คุณสามารถดาวน์โหลดเวอร์ชันล่าสุดได้โดยตรงจาก Maven และ ติดตั้งภายในโปรเจ็กต์ที่ใช้ Maven โดยเพิ่มการกำหนดค่าต่อไปนี้ใน pom.xml
ที่เก็บ
<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>
ขั้นตอนในการแปลง DXF เป็น PNG ผ่าน Java
- โหลดไฟล์ DXF ด้วยวิธี Image.load
- ตั้งค่าวัตถุของ CadRasterizationOptions ด้วยความสูง & ความกว้างของหน้า
- สร้างอินสแตนซ์ของคลาส PngOptions และตั้งค่าคุณสมบัติ VectorRasterizationOptions
- เรียกเมธอด Image.save ขณะส่งพาธไฟล์ผลลัพธ์ & ออบเจ็กต์ของ PngOptions
ข้อกำหนดการแปลง
- Microsoft Windows หรือ OS ที่เข้ากันได้กับ Java Runtime Environment สำหรับแอปพลิเคชัน JSP/JSF และแอปพลิเคชันเดสก์ท็อป - รับ Aspose.CAD เวอร์ชันล่าสุดสำหรับ Java โดยตรงจาก MavenDXF เป็น PNG Java Conversion Source Code
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
String srcFile = dataDir + "conic_pyramid.dxf"; | |
Image img = Image.load(srcFile); | |
// Create an instance of CadRasterizationOptions | |
CadRasterizationOptions rstrOptions = new CadRasterizationOptions(); | |
// Set page width & height | |
rstrOptions.setPageWidth(1200); | |
rstrOptions.setPageHeight(1200); | |
// Create an instance of PngOptions for the resultant image | |
ImageOptionsBase pngOptions = new PngOptions(); | |
//Set rasterization options | |
pngOptions.setVectorRasterizationOptions(rstrOptions); | |
// Save resultant image | |
img.save(dataDir + "conic_pyramid_raster_image_out_.png", pngOptions); |
แอพฟรีเพื่อแปลง DXF เป็น PNG
Convert DXF to PNG 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 DXF file, it will be converted instantly to PNG.
You will get the download link.