We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Words are not fully converted to PDF from Excel

Hi,

I am trying to convert multiple Excel files into single PDF.


The merge function works. However when the user alters the cell size from autofit to text. aspose only contains data similar to a screen shot.

Eg:
I set the font size of a string “Hi this pradeep” to 80. I reduce the cell size smaller to the word. Now the excel view shows only a part of the word.

When i present this doc to aspose.cell the PDF converted file also contains the same incomplete word (more like a screen shot). I have attached my code and sample input and output document.

Code:
if (Docwb == null)
{
Docwb = new Aspose.Cells.Workbook(fileData.LocalFileName);
}
else
{
Aspose.Cells.Workbook wb =
new Aspose.Cells.Workbook(fileData.LocalFileName);
Docwb.Combine(wb);
}


Hi Pradeep,


Thank you for contacting Aspose support.

Please note, Aspose.Cells APIs render spreadsheets to PDF in a similar way as the spreadsheets are viewed in the Print Preview of Excel application, that mean; without any additional configurations the Aspose.Cells APIs will render the spreadsheet exactly as Excel converts it. In this scenario the text size is larger than the row heights therefore when you render it with Aspose.Cells or Excel, the text seems to get trimmed from the top. You may avoid this problem by calling the Worksheet.AutoFitRows just before converting it to PDF format. Please check the following piece of code as well as the resultant PDF. I have also included a PDF that was saved with Excel 2013 for better elaboration.

C#

Workbook workbook = new Workbook(fileName);
foreach (Worksheet sheet in workbook.Worksheets)
{
sheet.AutoFitRows();
}
workbook.Save(“C:/temp/out.pdf”, SaveFormat.Pdf);