Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Oct 10, 2013 8:17 am

Good Morning,

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 :)

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Thu Oct 10, 2013 9:29 am

Hello,

Thanks for your inquiry.
Sorry for the inconvenience. Would you please share us with your word file? It will help us do a research.
Thank you!

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Thu Oct 10, 2013 9:34 am

Hi,

Thanks for the prompt reply. I am trying to attach the file, but keep getting The extension doc is not allowed.

Can I email it?

Thanks,
John.

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Thu Oct 10, 2013 9:53 am

Hi,

Please zip it firstly and attach, and you can also send it to our mailbox: [email protected].

Regards,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Oct 10, 2013 10:21 am

OK, I have zipped and attached the files. Not sure if you will be able to see the images though as they were linked with a UNC path??

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Fri Oct 11, 2013 6:46 am

Hello,

Thanks for your providing.
The images can not be displayed in your original word document when we open it because we have no permission to visit the UNC paths of these images, so we can not do a test to reproduce the issue, but we need the image data to do a research. Would you please carry out the following code and provide us with the data of data1, data1 and data2 respectively? Thank you!
Code: Select all
            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);


Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Fri Oct 11, 2013 7:05 am

Good Morning,

I have run that code and get the following error:

Illegal characters in path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Illegal characters in path.

What should I try next?
Thanks,

John.

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Fri Oct 11, 2013 9:07 am

Dear John,

Sorry for the inconvenience.
Spire.Doc gets the format of field value like "\"\\\\\\\\stroud34\\\\uniform\\\\uniform7\\\\Paul Bowley sig.jpg\"", so we need to do a conversion for filepath1. Please try the following code.

Code: Select all
            String filepath1 = fields[0].Value;
            String[] strs = filepath1.Split('\"');
            filepath1 = strs[1];
            String newfilepath1=filepath1.Replace("\\\\","\\");
       
            byte[] data1 = File.ReadAllBytes(newfilepath1);


Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Fri Oct 11, 2013 9:48 am

That worked, however, how do you want me to supply the data? I have tried converting the byte arrays to string but it does not give anything meaningful.

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Sat Oct 12, 2013 1:33 am

Dear John,

Please kindly save the byte data you got to a .bin file and send it to us. Thank you!
Code: Select all
File.WriteAllBytes("sample1.bin",data1);


Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Mon Oct 14, 2013 8:00 am

Thank you, I have attached 3 .bin files in the attached .zip file.

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Mon Oct 14, 2013 9:37 am

Dear John,

Thanks for your providng.
We just have done a test that added the image data you provided into test.doc file and converted it to PDF. The result PDF didn't miss these three images.
Our dev team will do a research to find the cause which caused the issue you met. We will tell you once there is any update on it.

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Mon Oct 14, 2013 10:08 am

Many thanks for your assistance :)

strouddc
 
Posts: 7
Joined: Mon Jun 10, 2013 2:51 pm
Location: Stroud, Gloucestershire, UK

Wed Oct 23, 2013 1:33 am

Dear John,

Thanks for your waiting.
The issue has been solved by our dev team. Our test team will do some tests for the new hotfix.
We will release it and inform you when the new hotfix passes all test cases.

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Wed Oct 23, 2013 8:24 am

Dear John,

Thanks for your waiting.
The new hotfix has been released. Please download and test Spire.Doc Pack (Hot Fix) Version:4.9.32(http://www.e-iceblue.com/Download/downl ... t-now.html).

Please feel free to contact us in case you have further problems.

Best regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3046
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc

cron