Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 943
  • Last Modified:

How to export Excel files to PDF? (Command line, C#, VB.net... whatever! :))

Hi guys, I need some help figuring this one out.

The thing is that I want to be able to generate a PDF file from and Excel file from C#.
I'm already using Gembox (http://www.gemboxsoftware.com/GBSpreadsheet.htm) and doing some tests with Bytescout Spreadsheet SDK (http://bytescout.com/products/developer/spreadsheetsdk/bytescoutspreadsheetsdk.html)

These work great for manipulating the excel files but none have the ability to save as PDF.

I've also tested exporting to HTML (that both above do) but it doesn't display as good and converting HTML to PDF ends up a mess or at least not as good as if I had just opened the Excel file manually and printed it using CutePDF.

I would prefer a way that I could embed in my .net application but a command line solution is also usable here... :)

So, does anyone know a way of doing this?

Thanks!
Alex
0
Alexandre Simões
Asked:
Alexandre Simões
3 Solutions
 
ragnarok89Commented:
I would recommend a FREE too called FDFill tools. When you install this app, you get the ability to "Print to PDF." Just print your doc, and select the PDFill printer instead of the physical one.

Al
0
 
telyni19Commented:
I recommend installing PDF995 as a print driver and then calling that programmatically to save your file. I'm not a C# programmer so I don't have specific code to give you, but the PDF995 site has some documentation on how to do this here:
http://www.pdf995.com/faq_dev.html
0
 
telyni19Commented:
I just saw that VBA code isn't out of the question. My previous post was assuming you wanted to do everything in C#. Here also is a thread with VBA code to print to PDF through PDF995:

http://bytes.com/topic/access/answers/633214-how-print-ms-access-2000-report-pdf995-printer-vba-code
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
james-ct16Commented:
Howdy
following up from telyni19 there is a good example over at code project of doing this in c# http://www.codeproject.com/KB/files/anyfiletopdf.aspx?fid=1527450&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2753203

Hope that helps
0
 
stagepCommented:
Look at FlexCel from tmssoftware.com
0
 
Alexandre SimõesManager / Technology SpecialistAuthor Commented:
Hi!
Thanks for the help.

I tried everything and more... :)
The best tool available for this is without a doubt the Aspose.Cells

I'll accept some answers as they actually work but not quite as I wanted.
One example is the link provided by james-ct16. It works great but opens the Excel window that is not desirable.

Thanks!
Alex
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now