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.

Mon Mar 29, 2021 8:41 pm

Hi,

We have a strange issue where an image is changing color when it is being added to a document via 'AppendPicture' or if using the mail marge feature in spire.doc. We are using .net5, so it seems to be using the System.Drawing namespace still, and this issue only happens on linux (Ubuntu 18 I believe) and not on windows.

Here is an example of code we are using to add the image:
Code: Select all
            using var doc = new Document();

            var section = doc.AddSection();
            var p = section.AddParagraph();

            // ms is the image stream
            var pic = p.AppendPicture(ms);


I have attached the original image, and a screenshot of how it looks after appending (it goes from orange to blue).

Please note that in our code, we also convert the word document to PDF, so it might be an issue with converting to PDF. However we have noticed that if we use OpenXML to build the word document manually with the same image, and then convert to PDF that we don't get the issue - so this seems to be a problem specifically with the 'AppendPicture' function (and the mail merge feature as well, which I assume uses the AppendPicture internally).

Cheers,
Felix

felix@kalixhealth.com
 
Posts: 20
Joined: Sat Nov 07, 2015 4:10 am

Tue Mar 30, 2021 11:09 am

Hello,

Thanks for your inquiry.
I tested your code and did reproduce your issue. I have logged it in our bug tracking system with the ticket SPIREDOC-5767. If there is any update, we will let you know. Apologize for the inconvenience caused.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc

cron