Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 28, 2021 8:52 pm

Hi, i use C# .NET5 on Windows
I'm trying this Spire.PDF to Excel and something is doing the wrong layout
Follow the code


var xMemo = new MemoryStream();
var xTeste = new Spire.Pdf.PdfDocument(aPdf);
xTeste.ConvertOptions.SetPdfToXlsxOptions(new Spire.Pdf.Conversion.XlsxLineLayoutOptions());
xTeste.SaveToStream(xMemo, Spire.Pdf.FileFormat.XLSX);
return xMemo;

Thanks.

gusyavoo
 
Posts: 5
Joined: Tue Sep 28, 2021 8:39 pm

Wed Sep 29, 2021 3:12 am

Hello,

Thank you for your inquiry.
I tested your PDF file, but did not find the behavior you mentioned. Here I attached my generated Excel for your reference. The version I used is the latest Spire.PDF (Spire.PDF Pack(Hot Fix) Version:7.9.6), if you were not using the latest version, I suggest you first give it a try. If the issue still exists after trying, please provide your test environment to help us do further investigation, such as OS info (E.g. Windows 7, 64-bit) and region setting (E.g. China, Chinese). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Sep 29, 2021 12:40 pm

thanks for reply.
I tried in the lastest version, 7.9.6
My environment is Windows 10 64bit, region america.
Application in .NET5

this simple code not working for me (printed like i mentioned in previous post)

var xTeste = new Spire.Pdf.PdfDocument("C:/Users/Gustavo/Desktop/erros/PDF.pdf");
xTeste.ConvertOptions.SetPdfToXlsxOptions(new Spire.Pdf.Conversion.XlsxLineLayoutOptions());
xTeste.SaveToFile("C:/Users/Gustavo/Desktop/erros/Output.xlsx", Spire.Pdf.FileFormat.XLSX);

I too tried on server (Debian, Azure) and i got the same problem.
I install via nuget: Install-Package Spire.PDF -Version 7.9.6
Need adicional feature to work?

EDIT: In the same project i have freespire.doc installed
EDIT2: My friend opened the same document in libre calc and opened fine, i use office 365 (PT-BR) to open documents xlsx, it is required adicional configuration maybe?
EDIT3: I tried with office 365 EN-US 32 bits, but same problem, happens only with microsoft office.

gusyavoo
 
Posts: 5
Joined: Tue Sep 28, 2021 8:39 pm

Thu Sep 30, 2021 9:48 am

Hello,

Thank you for sharing information.
I tested your PDF file in the same environment as yours (Debian and Azure), but neither can reproduce your problem. Here I attached my test demo for your reference. Please deploy it on your side to have a try. If the problem only occurs in your project, there must be some differences on settings of your project, please provide your whole project which can reproduce your problem for our further investigation. You could upload it to the DropBox or OneDrive and then share the download link with us. Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Thu Sep 30, 2021 11:21 am

I got the same problema with yours project.
I created a new project to this test, so i guess the problem is excel region configuration (becase others programs works great).
I tried everthing on excel but i dont fix.

Look, when i put this line works great:
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

Have any place where can it especify culture? Because i cant put this on my code.

gusyavoo
 
Posts: 5
Joined: Tue Sep 28, 2021 8:39 pm

Thu Sep 30, 2021 12:31 pm

I Will buy this product,
For now, i do like this:

var xStream = new MemoryStream();

var xThread = new Thread(new ThreadStart(() =>
{
var xDocument = new Spire.Pdf.PdfDocument(aPdf);
xDocument.ConvertOptions.SetPdfToXlsxOptions(new Spire.Pdf.Conversion.XlsxLineLayoutOptions());
xDocument.SaveToStream(xStream, Spire.Pdf.FileFormat.XLSX);
}));

xThread.CurrentCulture = new CultureInfo("en-US");
xThread.Start();
xThread.Join();

return xStream;

But i need a patch for this bug, when cultureinfo is pt-br
Another question, can i put in toguether with spire.doc in the same project?

gusyavoo
 
Posts: 5
Joined: Tue Sep 28, 2021 8:39 pm

Fri Oct 01, 2021 2:13 am

Hello,

Thanks for sharing more information!

I did reproduce your issue by the code you provided when I setting the “CurrentCulture = new CultureInfo("pt-br")”. This issue has been submitted to our Dev team with the ticket SPIREPDF-4692 for further investigations.

If there is any update, we will keep you informed. Sorry for the inconvenience caused

Besides, if you want to use two or more Spire products in one project (such as Spire.PDF and Spire.Doc), please use Spire.Office for Net 6.9.1 to achieve it. Spire.Office for .NET is a combination of Enterprise-Level Office .NET API offered by us and it include all of our products.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Oct 01, 2021 3:41 am

Hello,

I Glad that they reproduce the issue.
I Use freespire.doc because is very simple what i doo, is not necessary the Aspire.Office.

So Spire.Pdf and Spire.Doc is incompatible in same project? Just to confirm.

gusyavoo
 
Posts: 5
Joined: Tue Sep 28, 2021 8:39 pm

Fri Oct 01, 2021 4:33 am

Hello,

Yes, Spire.Pdf and Spire.Doc is incompatible in same project, and this may cause some conflicts. So you need use Spire.Office to avoid this.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Oct 11, 2021 9:28 am

Hello,

Thanks for your patience!

Glad to inform you that our Dev team had solved the issue of SPIREPDF-4692. Here we made a temporary version (spire.pdf_7.10.2.zip) for you, please download and test with it.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Tue Oct 19, 2021 3:44 am

Hello,

Thanks for your patience!

Glad to inform you that we just released Spire.PDF Pack(Hot Fix) Version:7.10.4 which fixes the issue of SPIREPDF-4692.

Please download the fix version from the following links to test.

Website link: https://www.e-iceblue.com/Download/download-pdf-for-net-now.html
Nuget link: https://www.nuget.org/packages/Spire.PDF/7.10.4
https://www.nuget.org/packages/Spire.PDF.NETCore/7.10.4

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Oct 25, 2021 1:10 am

Hello,

Hope you are doing well!

Has the issue been solved now? Could you please give us some feedback at your convenience?

Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.PDF

cron