Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2010-09-16
6
Medium Priority
?
929 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 1000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Assisted Solution

by:james-ct16
james-ct16 earned 1000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

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…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

664 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