C# - Convert DOCX To PDF Programmatically Without Word Installed?
Jan 15, 2011
I have a web application and I need to convert DOCX files to PDF to generate some reports wtiten in Word 2007. First I used automation and I faced a DCOM problem and finally I discovered that Microsoft doesn't support automation of Word on the server side.Now I'm searching for other free tools as opposed to Word and etc isn't free, iTextSharp doesn't convert DOCX to PDF.
I am maintaining a web application that allows word template documents do be opened inside the browser.
Recently the client upgraded to windows 7 and MS Word 2007 and my problems started... When a template document is opened inside the browser and saved, the original file is overwrited instead of a new word file being created.
Is there a way to force ms word inside the browser to behave the same as when it runs outside the browser?
I'm hoping this is an easy one...I'm using Microsoft.Office.Interop.Word to convert uploaded word documents into previewable html files. I haven't implemented it fully, but I've played around with it enough that I think I have a plan that will work... My question revolves around
I'm not in love with the idea of opening word and closing it everytime there's an upload (which I hope is a lot of the time) I'd like to make this a shared object that loads at application start. I have 2 questions that go along with this. 1. I imagine that winword could lock up and that would be a problem, right? 2. to save a document I use wordapp.ActiveDocument, this could have an issue as a shared object, right? I think I'm talking myself right out of this...
I installed VS2010 and proceded to convert my projects but the wizard failed. Insted I decided to recreate the whole solution with 5 projects from scratch, except that my Ajax 4.0 controls do not work. The projects are "Class" type and the final product is complied DLL that I'll be using some place else.
I am referencing the latest AjaxControlToolKit and in one of my projects where I'm building tab panel controls on the fly, where I'm adding "Controls" to the TP such as tpOverdue.Controls.Add(linkButton), the "Controls" throws an error:
'AjaxControlToolkit.TabPanel' does not contain a definition for 'Controls' and no extension method 'Controls' accepting a first argument of type 'AjaxControlToolkit.TabPanel' could be found (are you missing a using directive or an assembly reference?)
Another error I get in a separate project (same solution) where I build the scriptmanager on the fly like this: ScriptManager.RegisterStartupScript(this, typeof(PeopleSearch), "UpdatePanelFixup", "_spOriginalFormAction = document.forms.action; _spSuppressFormOnSubmitWrapper=true;", true); - The error is: "The name 'ScriptManager' does not exist in the current context".
Interestingly, this solutiom resides on a 2003 server (developping on test server). I have similar solution on Vista using VS2010 where the difference is that instead of using class projects in my solution I use Web User Controls in my web solution and all works like a charm. I don't know if this is enough info for you guys to offer feedback, so if neccessary, I can post some code. Just let me know.
I'm about to start an application that will allow users to upload an amount of text to a SQL database via an ASP.NET webform. I am certain that many users will cut and paste the text from Word, together with all the formatting and other baggage that Word creates. I'm looking for a way of programatically stripping out all of this stuff and leave just plain text.
The purpose is to generate proposal documents that can manually be edited in Word after the fact, but before sending them out to the customers.
Much proposal content would be drawn from existing HTML website content (backing CMS) and also some custom (non-HTML) injection for certain scenarios. Of course the conditional logic could go into server-side ASP.NET to vary the content appropriately.
I'm open to 3rd-party tools if raw manipulation of the Word API is arduous. In fact a good 3rd party tool might be the answer.
I've found a way with .NET to create word documents but it doesn't take any of the HTML markup and 'convert' it. For example, a <br /> does not create a new line, it just writes out the html tag in my word document.
I could certainly write some kind of parser to do this, but if there's already an easier solution out there, I'd rather save the time. I've found a few solutions that want money, but I'd rather find something for free if possible. I'd think that given .NET and Word are both MS technologies, this would be out there somewhere.
I just installed a fresh copy of the newly minted windows 7 RTM. then, installed vs2008 team suite edition, did vs2008 sp1 and now, my .csproj projects (all of them) say can not be opened by this version of vs2008.
I have a MS word documented which is formatted with colors and images. I need to convert it to html page. But when I save it as html or paste it in visual studio, A lot of raw html is added. How can I do this?
I am creating a word doc via a stringbuilder. When I open the word doc it asks about converting and when I select html from the list it opens just fine. i would like to omit the step where the user has to select html and it just open.