从 Visio PHP 页面中提取所有图像

Aspose.Diagram - 从 Visio 页面中提取所有图像

使用 Visio 页面提取所有图像Aspose.Diagram Java 用于 PHP 只需调用提取图像模块。在这里您可以看到示例代码。

PHP代码

 # Create instance of Diagram

$diagram = new Diagram($dataDir."drawing.vsd");

$shapes = $diagram->getPages()->getPage("Flow 1")->getShapes();

$i = 0;

$typeValue=new TypeValue();

while ($i <(int)(string)$shapes->getCount()){

$shape = $shapes->get($i);

\# Filter shapes by type Foreign

if ($shape->getType()== $typeValue->FOREIGN){

\# create an image file

$fos = new FileOutputStream($dataDir."Image#{i}.bmp");

$fos->write($shape->getForeignData()->getValue());

$fos->close();

}

$i += 1;

}

print "Extracted images successfully!".PHP_EOL;

下载运行代码

下载**从 Visio 页面中提取所有图像 (Aspose.Diagram)**来自以下任何社交编码网站: