管理OLE对象
Contents
[
Hide
]对象链接和嵌入(OLE)是一个Microsoft Windows特征,它允许您在保持编辑原始应用程序中的信息能力的同时,将信息从一个应用程序复制或移动到另一个应用程序。基本上,OLE将来自不同应用程序的数据组合到一个文档中。要使用OLE,您需要支持OLE的源应用程序和目标应用程序。
导出嵌入的OLE对象
Aspose.CAD for Java现在支持从DWG格式导出嵌入的OLE对象。本文演示了如何使用Aspose.CAD将嵌入的OLE对象从DWG格式导出为PNG。
下面的示例代码用于实现此功能。
This file contains hidden or 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 dataDir = Utils.getDataDir(ExportOLEObjects.class) + "DWGDrawings/"; | |
String[] files = new String[] { "D ZD junior D10m H2m.dwg", "ZD - Senior D6m H2m45.dwg" }; | |
PngOptions pngOptions = new PngOptions(); | |
CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions(); | |
pngOptions.setVectorRasterizationOptions(rasterizationOptions); | |
rasterizationOptions.setLayouts(new String[] { "Layout1" }); | |
for(String file : files) | |
{ | |
CadImage cadImage = (CadImage)Image.load(dataDir + file); | |
cadImage.save(dataDir + file + "_out.png", pngOptions); | |
} | |