tags:

views:

136

answers:

2

I'm going to save documents from an ASP.NET web site to server disk. I can simply save it as html, but probably other document formats wiдl be more appropriate. If so, how save it as DOC PDF or other (in ASP.NET c#)?

+1  A: 

If you require precise rendering, you can forget about HTML. If not, it is a great choice.

Word Binary Format (97-2003) is currently slowing being phased out, so I would forget about it too (for sake of being able to open your documents in 15 years). Plus, it is a proprietary format, which means you are locked in to vendor support to read/write your document.

Which leaves you with two choices if you require precise rendering: PDF and XPS.

XPS is a fairly new format backed by Microsoft. Unfortunately, support behind it is kinda low at the moment. But it will probably gain momentum due to the fact that it is an open format.

PDF on the other hand is a well known format that has been backed for a lot of years. If you want to keep a precise render of a document and still (by any chance) be able to open it in a few years, I think it would be your best bet, but XPS is still a great choice.

Andrew Moore
I think that office binary will be around for longer than that, just maybe not in MS Office. There are too many legacy documents around at this point for people to keep moving to new formats (hard work to begin with). On the other hand, there are a lot of people who want these documents to stay readable.
Dana the Sane
**@Dana the Sane:** Yes, but they are also plenty of legacy formats which are still in active use and have been for quite a while (OpenDocument, PDF) and that have public specifications in-case the format is ever phased out, which makes it easier if you need to develop your own reader/writer in 20 years.
Andrew Moore
A: 

You can save it as as PDF by using any of a number of print to PDF utilities. CutePDF Writer is one example of those. It installs as a printer driver, so you can print PDFs from any application.

If you are going to create documents on the fly from the web server, you will need something else like PDFSharp.

http://www.pdfsharp.com/

Robert Harvey
How long the pdf format will be actual?
Constantine