사용자 정의 속성 추가

사용자 정의 속성 추가

Aspose.CAD for Java API를 사용하면 DXF 및 DWG 파일에 사용자 정의 속성을 추가할 수 있습니다. 이를 위해 API는 CadImage.Header.CustomProperties.Add 메서드를 제공합니다. 다음 코드 스니펫은 CadImage.Header.CustomProperties.Add 메서드를 사용하여 DXF 파일에 사용자 정의 속성을 추가하는 방법을 보여줍니다.

// For complete examples and data files, please go to https://github.com/aspose-cad/Aspose.CAD-for-Java
String dataDir = Utils.getDataDir(ExportDXFToWMF.class) + "DXFDrawings/";
String srcFile = dataDir + "conic_pyramid.dxf";
String outFile = dataDir + "AddCustomProperties_out.dxf";
CadImage cadImage = (CadImage)Image.load(srcFile);
cadImage.getHeader().getCustomProperties().put("CUSTOM_PROPERTY_1", "Custom property test 1");
cadImage.getHeader().getCustomProperties().put("CUSTOM_PROPERTY_2", "Custom property test 2");
cadImage.getHeader().getCustomProperties().put("CUSTOM_PROPERTY_3", "Custom property test 3");
cadImage.save(outFile);