In some cases when cells are merged the cell borders are not correctly imported.
When the Workbook has more than one sheet a localSheetId should be exported:
<definedName name="xlnm.Print_Titles" localSheetId="0">Sheet1!$A$1</definedName>
localSheetId (from the OOXML specification): Specifies a boolean value that indicates whether the defined name is related to an external function, command, or other executable code.
When the spreadsheet contains empty rows and the format of some cells is set the rows are still exported to pdf or printed.
To workaround this set the print area with the following code:
IPropertyDefinition[] propertyDefinitionsAffectiingPringing = new IPropertyDefinition[] { CellPropertyDefinitions.ValueProperty };
CellRange usedCellRange = workbook.Worksheets[0].GetUsedCellRange(propertyDefinitionsAffectiingPringing);
workbook.Worksheets[0].WorksheetPageSetup.PrintArea.SetPrintArea(usedCellRange);
At this point, only the styling is preserved without the hyperlink itself. Implement logic to add the hyperlink to the generated PDF document.
Workaround: check the attached project.