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 Sep 17, 2018 9:06 am

Hello Kevin,

Greetings from E-iceblue.
Could you let us know how is the issue going? 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

Tue Sep 25, 2018 9:52 am

Hello Kevin,

Greetings from E-iceblue.
Glad to inform that the "System.NullReferenceException" issue when using PS method to convert Docx to Pdf and setting the style.CharacterFormat.FontName = "宋体" has been fixed. Welcome to download Spire.Doc Pack(hot fix) Version:6.9.11 and test.
Besides, Could you please give us some feedback about the issue that you posted on 9/14? Thanks in advance.

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Mon Nov 12, 2018 8:48 am

Hi E-ICEBLUE Support,

I try to convert PDF to DOCX, but I got object not reference and a null exception for this.

Code: Select all
                                    pdf.LoadFromStream(file.InputStream);

                                    PdfUsedFont[] fonts = pdf.UsedFonts; // this return null

                                    if (fonts.Length > 0)
                                    {
                                        mf = fonts.GroupBy(v => v.Size)
                                        .OrderByDescending(g => g.Count())
                                        .First()
                                        .Key;
                                        PdfFont font = new PdfFont(PdfFontFamily.TimesRoman, mf, PdfFontStyle.Regular);

                                        foreach (PdfUsedFont f in fonts)
                                        {
                                            try
                                            {
                                                f.Replace(font);
                                            }
                                            catch (Exception ex)
                                            {
                                                continue;
                                            }

                                        }
                                    }
                                    pdf.SaveToStream(s, Spire.Pdf.FileFormat.DOCX);

Please find attached document. Thanks.
Kevin

nkeung
 
Posts: 19
Joined: Fri Sep 07, 2018 8:36 am

Tue Nov 13, 2018 1:20 am

Hi,

Thanks for your inquiry.
I have reproduced the issue and logged it in our bug tracking system. Once there is any update for you, we will let you know. Sorry for the inconvenience caused.
Sincerely,
Mike
E-iceblue support team
User avatar

Mike.Zhang
 
Posts: 93
Joined: Thu Sep 27, 2018 7:11 am

Tue Nov 13, 2018 6:49 am

Thanks, Mike. Please update me as soon as you get a result.

nkeung
 
Posts: 19
Joined: Fri Sep 07, 2018 8:36 am

Tue Nov 13, 2018 10:14 am

Hi,

Sure, I will keep you informed about the progress.
Sincerely,
Mike
E-iceblue support team
User avatar

Mike.Zhang
 
Posts: 93
Joined: Thu Sep 27, 2018 7:11 am

Mon Nov 26, 2018 6:25 am

Hi Mike, I have bought this product last week. The licensed .dll still haven't fixed this issue, how is the fix so far?

nkeung
 
Posts: 19
Joined: Fri Sep 07, 2018 8:36 am

Mon Nov 26, 2018 9:25 am

Hi,

Thanks for your waiting.
The issue of the null exception has been fixed now and we will provide the hotfix for you ASAP. As for replacing the fonts, sorry the font is not replaced successfully at present due to the complexity of the fonts in your PDF file. Our dev team is doing the in-depth investigation for finding a solution. Once there is any update, we will inform you. Apologize for inconvenient caused.
Sincerely,
Mike
E-iceblue support team
User avatar

Mike.Zhang
 
Posts: 93
Joined: Thu Sep 27, 2018 7:11 am

Tue Nov 27, 2018 8:52 am

Hi,

Hope you are doing well.
After our dev team's further investigation, we found that the encoding of the fonts in your original file is Identity-H, and the encoding of the substitute fonts is WinAnsiEncoding. The byte sequence values are invariable, but the Code Set and Decode Set have changed after replacing, since the encoding is different. This might lead to different corresponding characters after decoding. And we find if force the font to change using the code you provided, the character · would be changed to X.
original file:
original.png

result file:
result.jpg

Thanks for your understanding.
Sincerely,
Mike
E-iceblue support team
User avatar

Mike.Zhang
 
Posts: 93
Joined: Thu Sep 27, 2018 7:11 am

Wed Nov 28, 2018 8:42 am

Hi,

The issue of null exception has been fixed. Please download the hotfix from below link.
https://www.e-iceblue.com/downloads/Tem ... 3.11.6.zip
Sincerely,
Mike
E-iceblue support team
User avatar

Mike.Zhang
 
Posts: 93
Joined: Thu Sep 27, 2018 7:11 am

Return to Spire.Doc