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.

Tue Dec 11, 2018 5:01 pm

With Spire.Doc Free Edition, version 6.3.0.41040 we are testing document conversion capability, from doc to PDF.

With this code :
newDoc = New Spire.Doc.Document
newDoc.LoadFromFile(conv.DocPath, FileFormat.Auto)
newDoc.JPEGQuality = conv.JpgQuality
newDoc.SaveToFile(conv.PDFPath, FileFormat.PDF)
newDoc.Close()

we got this kind of exception:
System.ArgumentException: '-64' non è un valore valido per 'red'. 'red' deve essere maggiore o uguale a 0 e minore o uguale a 255.
in System.Drawing.Color.CheckByte(Int32 value, String name)
in System.Drawing.Color.FromArgb(Int32 alpha, Int32 red, Int32 green, Int32 blue)
in sprᣗ.ᜀ(Color A_0, Color A_1, Single A_2)
in sprᣗ.ᜁ(TextureStyle A_0, Color A_1, Color A_2, RectangleF A_3)
in sprᣗ.ᜁ(TableCell A_0, sprᾺ A_1)
in Spire.Doc.TableCell.Spire.Doc.Layout.IDocumentBase.Draw(sprᣗ dc, sprᾺ ltWidget)
in sprᾺ.ᜀ(sprᣗ A_0)
in sprᾺ.ᜀ(sprᣗ A_0)
in sprᾺ.ᜀ(sprᣗ A_0)
in sprᾺ.ᜀ(sprᣗ A_0)
in sprᾺ.ᜀ(sprᣗ A_0)
in sprᶌ.ᜀ(sprᣗ A_0)
in sprṕ.ᜀ(Int32 A_0, Int32 A_1, ImageType A_2, MemoryStream A_3, Boolean A_4, Boolean A_5, Boolean A_6)
in spr᫬.ᜀ(sprṕ A_0)
in spr᫬.ᜀ(Document A_0)
in Spire.Doc.Document.ᜂ(String A_0)
in Spire.Doc.Document.SaveToFile(String fileName, FileFormat fileFormat)
in DocDaServizi.clsDocDaServizi.ConvertDocToPDF(Dati_tabConversioni& conv, Exception& e) in D:\Progetti\xData\CSI\GesLabNet\GesLabNet\DocDaServizi\clsDocDaServizi.vb:riga 577

The problem seems to be the background colour of the first row of the table, currently is RGB(223,223,223), if we change to RGB(217,217,217) everything works fine. But we have hundreds of documents and we can not edit them all.

Any suggestion?

Kind Regards

roberto.fenoglio
 
Posts: 8
Joined: Wed Sep 18, 2013 1:15 pm

Wed Dec 12, 2018 2:54 am

Hi,

Thanks for your inquiry.
Sorry for the inconvenience our Free version caused. I have confirmed that the attached Word file worked well using Spire.Doc Pack(hot fix) Version:6.12.1. Note we have no plan to maintain free version. So please use the latest version and try again.
In addition, to help you evaluate our product better, our sales team has sent you one-month free license of Spire.Doc to help remove the warning message. How to apply the license.
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Dec 12, 2018 9:10 am

Thank you for your replay, but we still get the same error.
The installed version of Spire.Doc.dll is 6.12.1.4040.

roberto.fenoglio
 
Posts: 8
Joined: Wed Sep 18, 2013 1:15 pm

Wed Dec 12, 2018 10:19 am

Hi,

I made a demo for your kind reference, please have a check.
http://www.e-iceblue.com/downloads/demo/15858.zip
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Dec 12, 2018 10:38 am

Same error also with your code.
Attached a snapshot.

roberto.fenoglio
 
Posts: 8
Joined: Wed Sep 18, 2013 1:15 pm

Wed Dec 12, 2018 10:48 am

Hi,

Please provide the OS and Region information, e.g. Win7 64bit, China/Chinese.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Dec 12, 2018 11:25 am

Hi,
here the requested info:
Windows 10 Pro 64-bit, Ver. 1803, build 17134.407
Region Italy.

Kind Regards

roberto.fenoglio
 
Posts: 8
Joined: Wed Sep 18, 2013 1:15 pm

Thu Dec 13, 2018 1:53 am

Hi,

Thanks for your information.
After further investigation, I found the reason. Please use following code to set the culture.
Code: Select all
            //set culture
            CultureInfo cc = Thread.CurrentThread.CurrentCulture;
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;

            var newDoc = new Spire.Doc.Document();
            newDoc.LoadFromFile(@"test.doc", FileFormat.Auto);
            newDoc.SaveToFile("15858.pdf", FileFormat.PDF);

            Thread.CurrentThread.CurrentCulture = cc;

Any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Dec 13, 2018 8:47 am

Nice find, so your example works, good job. Now I try to integrate it into my project.

Kind regards

roberto.fenoglio
 
Posts: 8
Joined: Wed Sep 18, 2013 1:15 pm

Thu Dec 13, 2018 8:57 am

Hi,

Thanks for your feedback.
Please feel free to contact us if there is any question.
Have a nice day:)

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc