views:

95

answers:

5

Hi, guys.

The issue consists of two parts:

  1. What are the best .NET libraries to modify (read/write) existing excel document (should be work with Excel 2003)?

  2. What are the best .NET libraries to modify (read/write) existing pdf document?

They should be able to create new document too. It's better if they are free (open source) or not too expensive.

Thanks in advance :)

+1  A: 

For PDFs: iTextSharp. It's free and it's not hard to learn.

egrunin
A: 

Regarding Excel you might not need a library. If you've got Excel installed you can automate it to edit the document, or otherwise you might be able to do what you need just by accessing it via OLEDB to read/write data.

ho1
Automation is not normally a nice route to go down with Excel. It's difficult to use the API properly without hanging onto COM objects and hence close Excel down, and it isn't always possible if the environment can't support a UI (server hosted for example).
Ian
I dont want to use Automation or Interop, cause on server office could be not installed.I'm not OLEDB guru, but I do not think that it will give me an efficient way to manage files.
SchmerZ
@Ian: If you do it the proper way it should always close down properly, but I agree it can be a little messy to get right. You can use it without the UI, but the main problems is that it's slow and unstable, which of course gets much worse on a server.
ho1
@SchmerZ: Agree about automation on a server, but depending on what you mean with efficient OLEDB might be ok. If your Excel sheets contain tabular data, then I think OLEDB might work very well for reading and writing data, though if you need to do anything more advanced than that it might be unsuitable.
ho1
@ho1 : You can't use it in a non interactive environment (although in an interactive environment yes you can use it without a UI). Windows Vista and above prevent you from being able to user the Interop in non interactive environments.
Ian
@Ian: Ah, yes, I was thinking Windows 2003, mixing it up with the Excel 2003 in the question.
ho1
@ho1: Actually I need full functionallity to modify the document: set and get the value of cell's, add images and charts, etc.
SchmerZ
@SchmerZ: The only thing I've seen that might support all that is SmartXls at http://www.smartxls.com, but it's not free (though not horribly expensive either). I haven't tried it though, just looked at the website.
ho1
A: 

I evaluted a number of Libraries in this Post for reading Excel files. My preference was a library called FlexCel as it was very easy to use, quite cheap compared to the alternatives. We've been using it without any problems, has good support and frequent updates.

I believe it has some sort of PDF generation from Excel spreadsheets, I'm not sure if thats what you're after.

Other alternatives are Aspose, they offer an Excel and an Adobe PDF library. They are quite a bit more expensive though.

Ian
As I see FlexCel cannot add new charts to the document, isn't it?
SchmerZ
A: 

For Excels:SmartXLS for .Net,it is not expensive and has rich features.

liya