I am having a problem with spire.doc missing images from the original word file in the converted pdf. The images are linked with a UNC path, some appear, some do not. Please help me resolve this issue. Many thanks
Document document = new Document();
document.LoadFromFile(@"..\..\test.doc");
Queue<ICompositeObject> nodes = new Queue<ICompositeObject>();
nodes.Enqueue(document);
IList<Field> fields = new List<Field>();
while (nodes.Count > 0)
{
ICompositeObject node = nodes.Dequeue();
foreach (IDocumentObject child in node.ChildObjects)
{
if (child is ICompositeObject)
{
nodes.Enqueue(child as ICompositeObject);
}
else if (child.DocumentObjectType == DocumentObjectType.Field)
{
Field field= child as Field;
fields.Add(field);
}
}
}
string filepath1 = fields[0].Value;
byte[] data1 = File.ReadAllBytes(filepath1);
string filepath2 = fields[1].Value;
byte[] data2 = File.ReadAllBytes(filepath2);
string filepath3 = fields[2].Value;
byte[] data3= File.ReadAllBytes(filepath3);
String filepath1 = fields[0].Value;
String[] strs = filepath1.Split('\"');
filepath1 = strs[1];
String newfilepath1=filepath1.Replace("\\\\","\\");
byte[] data1 = File.ReadAllBytes(newfilepath1);
File.WriteAllBytes("sample1.bin",data1);