Save as pdf using ClosedXML
Asked Answered
L

3

8

Does ClosedXML have any function that can be used to save an excel file as PDF?

Currently i am using ClosedXML to create and populate the excel file and then using Interop to save as PDF.
But since Interop depends on the MS Office installed on the syatem the formatting changes on every version of MS Office. And since ClosedXML doesnt require having MS office installed it would be nice to be able to export or save as PDF directly from it without using Interops.

Lindesnes answered 24/3, 2017 at 13:4 Comment(2)
related: #15321613Clare
check: code.msdn.microsoft.com/Processing-excel-document-8969f948Overlong
H
12

Does ClosedXML have any function that can be used to save an excel file as PDF?

No.

Han answered 25/3, 2017 at 11:27 Comment(2)
I did find this nuget.org/packages/ClosedXML_Excel. I’m going to give it a try in the next few weeks, see if it works. Looks like it may be a fork of ClosedXML.Brittney
That lib worked really well for that purpose, but the sources are not available and it hasn't been updated since 2014.Orgulous
N
0

Instead you can use the free version of GemBox.Spreadsheet.

Also look at the top 10 libraries which allows us to manipulate excel.

However GemBox was the only free and featured one that I found with the purpose of creating an invoice report for a website, by converting excel to pdf.

Nolanolan answered 14/9, 2021 at 9:47 Comment(0)
A
0

you can use the ClosedXML.Excel and iTextSharp to convert Excel to PDF file. Here a link with example: Convert Excel file to Pdf in ASP.Net

Auten answered 5/5, 2022 at 17:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.