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.

Fri Nov 04, 2022 5:31 am

Hi guys

We're seeing another issue with PDF output using the new engine.

The code below correctly outputs text on multiple lines if useNewEngine is false. If useNewEngine is true then the output is all on one line.

Testing with 10.10.4

Code: Select all
var document = new Spire.Doc.Document(false);
//var document = new Spire.Doc.Document(true);  //newline characters ignored

var section = document.AddSection();

var table = section.AddTable(false);
table.PreferredWidth = new PreferredWidth(WidthType.Percentage, (short)100);

var row = table.AddRow(1);
var para = row.Cells[0].AddParagraph();
para.Text = "Testing\n\nNew line";

var docXStream = new MemoryStream();

document.SaveToStream(docXStream, Spire.Doc.FileFormat.PDF);

return docXStream.ToArray();

formsbyair
 
Posts: 9
Joined: Tue Mar 29, 2016 8:13 am

Fri Nov 04, 2022 9:08 am

Hello,

Thanks for your inquiry.
After investigation, I reproduced your issue and logged it into our bug tracking system with the ticket number SPIREDOC-8751. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Thu Nov 17, 2022 7:44 am

Hello,

Thanks for your patience!
Glad to inform you that we just released Spire.Doc 10.11.0 which fixes the issue with SPIREDOC-8751.
Please download the new version from the following links to test.

Website download link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget download link: https://www.nuget.org/packages/Spire.Doc/10.11.0

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Thu Nov 17, 2022 8:20 pm

Thanks but version 10.11.0 doesn't appear to include SPIREDOC-8751 as per https://www.e-iceblue.com/Introduce/wor ... 3aWsnZBxD8

It does include a different issue that I reported separately as per post48767.html#p48767 => SPIREDOC-8540

formsbyair
 
Posts: 9
Joined: Tue Mar 29, 2016 8:13 am

Fri Nov 18, 2022 1:46 am

Hello,

Thanks for your feedback.
I tested your issue with Spire.Doc 10.11.0 and I found this issue was solved. I suggest you can first test your issue with Spire.Doc 10.11.0.
If you have any issue, just feel free to contact us.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Fri Nov 25, 2022 9:46 am

Hello,

Has your problem been effectively solved now? Could you give us some feedback at your convenience?

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Sun Nov 27, 2022 8:02 pm

I've just tested with 10.11.0 and the issue is still there with the new engine, it's fine with the old engine

formsbyair
 
Posts: 9
Joined: Tue Mar 29, 2016 8:13 am

Mon Nov 28, 2022 9:59 am

Hello,

Thanks for your feedback.
I did more test again with theSpire.Doc 10.11.0, I created console project with .NetFramework4.8、console project with .NetCore 3.1 and console project with .Net6.0 to test your scenario on Win10, but I didn’t reproduce your issue. I attach my result pdf document. To help us reproduce your issue, please offer the following message, thanks for your assistance in advance.

1) Application type, such as Console App, .NET Framework 4.8.
2) Your test environment, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese).


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Nov 29, 2022 4:34 am

Here's the code I'm using to reproduce the problem (below)

I'm running a console app with .NET Framework 4.8 in Visual Studio 2022 on Windows 11 (22H2) in region New Zealand (English)

Code: Select all
            var document = new Spire.Doc.Document(true);  //newline characters ignored

            var section = document.AddSection();

            var table = section.AddTable(false);
            table.PreferredWidth = new PreferredWidth(WidthType.Percentage, (short)100);

            var row = table.AddRow(1);
            var para = row.Cells[0].AddParagraph();
            para.Text = "Testing\n\nNew line";

            document.SaveToFile("C:\\Users\\Shaun\\Documents\\Test.pdf", Spire.Doc.FileFormat.PDF);

formsbyair
 
Posts: 9
Joined: Tue Mar 29, 2016 8:13 am

Tue Nov 29, 2022 10:00 am

Hello,

Thanks for your feedback.
After more tests, I figured out why I didn’t reproduce your scenario: in my code, before saving file to PDF file, I saved the file to word document. I put my test code below. However, I have communciated with our development team, they will investigate and fix it. Sorry for the inconvenience caused.
Code: Select all
  var document = new Spire.Doc.Document();  //newline characters ignored

            var section = document.AddSection();

            var table = section.AddTable(false);
            table.PreferredWidth = new PreferredWidth(WidthType.Percentage, (short)100);

            var row = table.AddRow(1);
            var para = row.Cells[0].AddParagraph();
            para.Text = "Testing\n\nNew line";

            //This line of extra code than yours
            document.SaveToFile(@"../../output/old_result.docx", FileFormat.Docx);
            document.SaveToFile(@"../../output/222222new_result.pdf",FileFormat.PDF);


Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Fri Dec 30, 2022 7:19 am

Hello,

Greeting from E-iceblue.
For the issue with the number SPIREDOC-8751, I have some information to inform you:
The issue occurs when using “\n” as a line break in your code, according to the feedback from our development team, this issue currently will not be fixed currently due to you can using “\r\n” or “\r” as a line break to avoid this issue.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Fri Jan 13, 2023 9:50 am

Hello,

Greeting from e-iceblue.
Does the solution I provided solve your issue? Could you give some feedback at your convenience?

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Mon Jan 30, 2023 1:03 am

Yes, using \r instead of \n works fine with the new engine, thanks for your help.

formsbyair
 
Posts: 9
Joined: Tue Mar 29, 2016 8:13 am

Mon Jan 30, 2023 1:26 am

Hello,

Thanks for your feedback.
If you have any issue in the future, just feel free to contact us.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.Doc