Solved

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

Posted on 2010-09-16
6
915 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

752 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