Solved

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

Posted on 2010-09-16
6
911 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
Technology Partners: 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!

 
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

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

680 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