Solved

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

Posted on 2010-09-16
6
896 Views
Last Modified: 2012-05-10
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
Comment
Question by:Alexandre Simões
6 Comments
 
LVL 8

Expert Comment

by:ragnarok89
ID: 33696392
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
 
LVL 12

Expert Comment

by:telyni19
ID: 33696437
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
 
LVL 12

Assisted Solution

by:telyni19
telyni19 earned 250 total points
ID: 33696473
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Assisted Solution

by:james-ct16
james-ct16 earned 250 total points
ID: 33697611
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
 
LVL 2

Expert Comment

by:stagep
ID: 33699896
Look at FlexCel from tmssoftware.com
0
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 0 total points
ID: 33723057
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now