Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Thu Apr 27, 2023 8:54 am

Hi,

I have this code that converts sheets into pdfs.

MemoryStream pdfStream = new MemoryStream();

Workbook workbook = new Workbook();
workbook.LoadFromStream(stream, fileFormat);

Worksheet worksheet = workbook.Worksheets[0];

worksheet.PageSetup.PaperSize = PaperSizeType.PaperA4Rotated;
worksheet.PageSetup.IsFitToPage = true;

worksheet.SaveToPdfStream(pdfStream);

//checking the pages
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromStream(pdfStream);
var pages = doc.Pages;

When I debug and look into the converted pages I see the size hasn't been rotated and is using the default A4 format.
The same result is seen in the end pdf that is produced.
Same problem is for PaperA3 - PaperA3Rotated - it is using the A4 format for PaperA3Rotated.

I am using FreeSpire.Office version 8.2.0.

Thanks for the reply in advance!

Krisko_99
 
Posts: 4
Joined: Tue Apr 25, 2023 9:05 am

Fri Apr 28, 2023 3:17 am

Hi,

Thanks for your feedback.
I did reproduce your issue after testing your code. I have logged this issue into our tracking system with the ticket SPIREXLS-4643, our Dev team will do further investigation and fixing. Once there is any update, we will keep you informed. Sorry for the inconvenience caused.

Best Regards,
Herman
E-iceblue support team
User avatar

Herman.Yan
 
Posts: 115
Joined: Wed Mar 08, 2023 2:00 am

Thu Jun 01, 2023 9:23 am

Hello,

Glad to inform that we just released Spire.XLS Pack(Hotfix) Version:13.5.6 which fixed the issue of SPIREXLS-4643, please download the latest commercial version from the following links to test.
Website link: https://www.e-iceblue.com/Download/down ... t-now.html
Nuget link: https://www.nuget.org/packages/Spire.XLS/13.5.6
Besides, sorry that we only upgrade our free version irregularly, this fixes only was updated in our commercial version, we are willing to provide a temporary license(one month free) to help you evaluate our commercial version better. If you need it, just feel free to contact.

Sincerely,
Lisa
E-iceblue support team
User avatar

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

Return to Spire.XLS