New Features has been Added on Excel to PDF Conversion with Spire.XLS 7.0.11

We are pleased to announce the release of Hotfix Version Spire.XLS 7.0.11. In this new version, we have greatly improved the feature of Excel to PDF conversion. In order to meet the requirements of correctly converting Excel files containing special data formats to PDF and let the Excel data perfectly fit the PDF page, five features and one method have been added in this new hotfix. Also one bug has been fixed.

New Features when Convert Excel to PDF

Feature1: Fit Excel Sheet to One PDF Page Automatically

In normal situation, when we convert Excel with many blank rows between lines of data, some data will be converted to the second PDF page. Now, there are options to resize worksheet to fit PDF page. Please see the code below:

/// Options of resize worksheet to fit PDF page.
public enum FitToPageType
	/// Does not resize the worksheet, split it.
	/// Keeps the original size of the worksheet,
	/// even if it is large than the PDF page size.
	/// If there is one or more worksheets large than the PDF page,
	/// resize all worksheet with the same factor to fit PDF page.
	/// If there is one worksheet large than the PDF page,
	/// resize it to fit PDF page.
settings.FitSheetToOnePage = FitToPageType.ScaleWithSameFactor;

Feature2: Support Indentation and Left/Right Justification
Feature3: Support Gradient FillPattern of Cells
Feature4: Support all types of Borders
Feature5: Support Page Break of Sheet

New Method: Add extension method SaveToPdf into Workbook (supports C# >= 3.0)
This new method: Workbook.SavetoPdf makes the Excel to PDF conversion more simpler. You can see the method detail below:

workbook.LoadFromFile(@"Report.xlsx", ExcelVersion.Version2010);
workbook.SaveToPdf("Report.pdf", new Spire.Xls.Converter.PdfConverterSettings
	FitSheetToOnePage = Spire.Xls.Converter.FitToPageType.NoScale

Fixed Bug: Fix bug of Picture offset from cell
We fix the bug that pictures are offset after Excel to PDF conversion by respectly adding EvaluateLeftPosition(); to LeftColumnOffset.set, EvaluateRightPosition(); to RightColumnOffset.set and EvaluateTopPosition(); to TopRowOffset.set.

Want to try or test the new features? Please visit the download page:

Written by support iceblue.