xlsio to pdf

Buon giorno

Devo convertire un foglio XLS generato con le Vs. classi in un pdf.

Non riesco a generare il PDF in landscape.

Ottengo  SEMPRE il foglio excel in Landscape e il documento PDF in Portrait.

Mi potete aiutare ?


Questo è il mio codice:

///////////////////////////////

[...omissis...]

sheet.PageSetup.FitToPagesWide = 1;

sheet.PageSetup.FitToPagesTall = 1;

sheet.PageSetup.Orientation = ExcelPageOrientation.Landscape ;


XlsIORenderer renderer = new XlsIORenderer();


PdfDocument pdfDocument = new();

pdfDocument.PageSettings.Orientation = PdfPageOrientation.Landscape;

pdfDocument = renderer.ConvertToPDF(sheet);


Stream stream = new FileStream("C:\TEMP\TEST.PDF", FileMode.Create, FileAccess.ReadWrite);

pdfDocument.Save(stream);


[... Omissis... ]


2 Replies

MC Mohan Chandran Syncfusion Team October 21, 2021 06:56 AM UTC

Hi Gimmy, 

We have confirmed the issue as Exporting Excel to PDF in Landscape orientation is improper. We have logged a defect report for this issue and the fix will be included in our upcoming weekly NuGet release which will be available by October 26th, 2021. 

Regards, 
Mohan. 



KK Konduru Keerthi Konduru Ravichandra Raju Syncfusion Team October 26, 2021 04:15 PM UTC

Hi Gimmy, 

We appreciate your patience. 

We have included the fix for the issue Exporting Excel to PDF in Landscape orientation is improper in our weekly NuGet release version 19.3.0.47. The NuGet package can be downloaded from below link. 

Regards, 
Keerthi. 


Loader.
Up arrow icon