如何从文件网内容引擎中检索具有文档 ID 的文档的多个图像



>我需要从文档中检索图像并将其以字节流格式放置在共享路径位置。我有权访问文档 ID,并且已建立与 filenet 内容引擎的连接。有没有人知道从文档中检索图像的 api 代码。如果有多个图像,我该如何迭代这些图像。

看看 IBM 的这个例子:

public static void WriteContentToFile(IDocument doc, String path)
{
String fileName = doc.Name;
String file = Path.Combine(path, fileName);
try
{
FileStream fs = new FileStream(file, FileMode.CreateNew);
BinaryWriter bw = new BinaryWriter(fs);
Stream s = doc.AccessContentStream(0);
byte[] data = new byte[s.Length];
s.Read(data,0,data.Length);
s.Close();
bw.Write(data);
bw.Close();
fs.Close();
}
catch (Exception e)
{
System.Console.WriteLine(e.StackTrace);
}
}

最新更新