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.

Wed Apr 03, 2019 4:33 am

Please see attached Word document. Running this trivial load/save code, the borders on some of the shapes are lost.

I also noticed that the second purple box lost its background color.

Code: Select all
using Spire.Doc;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            Document document = new Document();
            document.LoadFromFile("Demo_in.docx", FileFormat.Docx);
            document.SaveToFile("Demo_out.docx", FileFormat.Docx);
            document.Close();
        }
    }
}

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Wed Apr 03, 2019 6:35 am

Hello,

Thanks for your post.
I have reproduced this issue and logged it into our bug tracking system for further investigating and fixing. If there is any update, we will let you know. Sorry for the inconvenience caused.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Wed Apr 03, 2019 3:11 pm

Thank you. Can you think of a workaround in the meantime? I can probably figure out heuristically if the shape should have a border and set it immediately. Is it the:

TextBox.Format.NoLine

That's a problem? I notice it's "true" for the affected shapes, and "false" for the unaffected shapes.

Edit: indeed, by setting this to false in the affected boxes, the problem goes away. So the bug seems to be that NoLine was true. However, when exporting to PDF, the bug didn't happen, so perhaps I'm missing something.

I still don't have an answer for the purple background being lost.

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Wed Apr 03, 2019 6:37 pm

For the color, the problem seems to be some combination of:

TextBox.Format.FillEfects.Type is set to BackgroundType.NoBackground instead of BackgroundType.Color
TextBox.Format.FillColor is "0"

I'm not sure why this happens in one box but not the others.

As a workaround I tried to set FillEfects.Type to BackgroundType.Color for every case that I had FillEfects.Color as non-white. This wasn't enough. So I also tried:

Code: Select all
textBox.Format.FillColor = textBox.FillColor;


Code: Select all
textBox.Format.FillColor = textBox.Format.FillEfects.Color;


Code: Select all
int argb = textBox.FillColor.ToArgb();
textBox.Format.FillColor = Color.FromArgb(argb);


However, none of these did anything to change textBox.Format.Color. It remains "00000000", even though textBox.FillColor and textBox.Format.FillEfects.Color are both correctly "ffcc99ff".

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Wed Apr 03, 2019 6:52 pm

It turns out that the missing part was:
Code: Select all
textBox.Format.FillEfects.Gradient.On = true;


So with both of these, everything works (including TextBox.Format.FillColor becoming correct automatically):

Code: Select all
textBox.Format.FillEfects.Type = BackgroundType.Color;
textBox.Format.FillEfects.Gradient.On = true;


I hope this helps your developers to fix the bug.

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Wed Apr 03, 2019 9:20 pm

My fix actually ended up incorrectly adding color to some TextBox's which had a non-white FillColor in Spire but in Word had a white fill. I've attached these as well, so that your developers can have additional test cases for their fix.

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Thu Apr 04, 2019 3:53 am

Hello,

Thanks for your more information. I have forwarded them to our Dev team, they will do further investigations to fix it or see if any workaround. Once there is any update, I will let you know immediately.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Fri Apr 19, 2019 9:05 am

Hello,

Thanks for your patient waiting.
Your issue has been fixed, welcome to download the hotfix from the following link.
Website link: Spire.Doc Pack(hot fix) Version:7.4.11
Nuget link: https://www.nuget.org/packages/Spire.Doc/7.4.11

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1182
Joined: Tue Sep 27, 2016 1:06 am

Fri Apr 19, 2019 8:54 pm

Thank you. I will try to test this when I get a chance but it may be a few days.

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Mon Apr 22, 2019 1:41 am

Hello,

Thanks for your feedback. No problem, hope everything goes well.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Mon May 06, 2019 8:51 am

Hello,

Greetings from E-iceblue.
Did the hotfix version work for you? Thanks in advance for your valuable feedback and time.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Sat Jul 13, 2019 6:23 am

My apologies for the late response. This does seem to fixed now. I initially had an issue in 7.6.5 with colors of shapes in the header/footer, but I just tested with 7.6.16 and it seems fixed now.

owurman
 
Posts: 20
Joined: Tue Apr 04, 2017 8:43 pm

Mon Jul 15, 2019 1:27 am

Hello,

Glad to hear that the latest version resolved your issue. Any question, just feel free to contact us.
Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc