Automate converting office documents to pdf in c#

I am functioning on turning word doctors and also succeed to pdf and also automate the entire procedure. Our team possess a web server request that prints all the.doc and.xls reports utilizing COM interop and our company wish to possess those data converted to PDF as opposed to imprinting them. I referred to Just how perform I convert Word files to PDF programmatically? as well as likewise to convert the documentations to PDF as well as i managed to convert all of them. When i was actually doing some more research on the subject i found that it is actually certainly not advisable to call Office Interop coming from Hosting server Edge treatment (Office files to PDF), therefore i thought and feelings of making use of one thing like a PDF printer chauffeur making use of which i may configure to bypass the Save As discussion. The i downloaded PDF as well as used the following code to assess the output

I need to have to open up a Microsoft Word document, switch out a few of the text then convert to a pdf byte collection. I have generated code to do this but it entails conserving the pdf to disk as well as checking out the bytes back in to memory. I would love to avoid writing just about anything to the hard drive as I perform certainly not need to save the report.

if you’re aiming to automate, you need to utilize a console application, certainly not a windows application. different compliation specifications, then you may use the console application from various other plans

I would certainly additionally as if to understand if there is a far better means to go concerning it? I did have a look at the public libraries to convert word to pdf however the complication was our team may possess to acquire separate elements for word and yet another one for stand out and one for slides which will be actually costly. Our company thought of making use of an ink-jet printer chauffeur which would certainly be actually best to manage different types of papers.

To clarify why I need to carry out this, I yearn for customers of an ASP.NET MVC document to be actually capable to upload a report layout as a word document which when come back to the internet browser is actually presented as a pdf.

How can I obtain the exact same result without contacting the disk? The entire operation needs to manage in memory.

Words interop installations are typically certainly not efficient in creating to an additional resource than disk. This is actually primarily since the SDK is an UI based SDK, it is certainly not meant to carry out background stuff since it highly relies on the UI. (In reality, it is actually simply a wrapper around the UI application, certainly not the sensible coating behind it).

You should certainly not utilize the Office interop installations on ASP.NET. Check out Scrutinies for server-side Computerization of Office, which mentions: Microsoft does certainly not presently recommend, as well as carries out not sustain, Computerization of Microsoft Office requests coming from any sort of unattended, non-interactive client treatment or even element (including OR NET, ASP.NET, DCOM, as well as NT Providers), considering that Office might show unsteady habits and/or predicament when Office is actually run in this setting.

It operates in my carton and also i require to test it in the server. I merely realized while evaluating it, i am obtaining exemption “No Process tied up with this object” at the product line (! process.hasexited) just for.xls documents but certainly not for.doc and.ppt files. I am actually wondering why, i made an effort to look at the Refine Monitor ( however could possibly not find it. Yet it does operate for.doc reports without tossing the exemption. Any tip why?

Leave a Reply

Your email address will not be published. Required fields are marked *