Managing OLE Objects
Contents
[
Hide
]Object Linking and Embedding (OLE) is a Microsoft Windows feature that allows you to copy or move information from one application to another while you retain the ability to edit the information in the original application. Basically, OLE combines data from different applications into one document. To use OLE, you need both source and destination applications that support OLE.
Exporting Embedded OLE Objects
Aspose.CAD for Java now supports exporting embedded OLE objects from DWG format. This article demonstrates how you can export embedded OLE objects from DWG format to PNG using Aspose.CAD.
The sample code is given below to achieve this feature.
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 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); | |
} | |