Here's a sample code to convert a xlsx file to pdf using OpenXML and iTextSharp libraries in C#:
main.cs2265 chars60 lines
To use this code, simply call the ConvertExcelToPDF
method and pass in the path to the xlsx file, as well as an output folder to save the PDF file to:
main.cs53 chars2 lines
Note that you'll need to add the iTextSharp NuGet package to your project in order to use the iTextSharp.text
and iTextSharp.text.pdf
namespaces.
gistlibby LogSnag