C# .NET - convert doc to gif image

Asked By raymond hsu
20-Nov-09 05:05 AM
Hi,

I wanted to develop an application which can  generate images (GIFs) of microsoft documents(like
doc, docx, xls).

Thanks,
Raymond
  Venkat K replied to raymond hsu
20-Nov-09 05:44 AM

You can download these components to convert doc to gif.

http://shareware.software.informer.com/download-shareware-convert-word-doc-to-gif/

Thanks,

check this  check this

20-Nov-09 06:27 AM

using System;


using System.Collections.Generic;


using System.ComponentModel;


using System.Data;


using System.Drawing;


using System.Text;


using System.Windows.Forms;


using Nevron.UI.WinForm.Controls;


using Office = Microsoft.Office.Core;


using Word = Microsoft.Office.Interop.Word;


using System.Drawing.Imaging;


 


namespace UITest


{


    public partial class Form1 : Form


    {


        public Form1()


        {


            InitializeComponent();


        }


 


        private void Form1_Load(object sender, EventArgs e)


        {


 


        }


 


        private void button1_Click(object sender, EventArgs e)


        {


            object oMissing = System.Reflection.Missing.Value;


            object oTrue = true;


            object oFalse = false;


 


            Word.Application wdApp = null;


 


            // Start a new Word instance if necessary


            if (wdApp == null)


                wdApp = new Word.ApplicationClass();


 


            // Create a new document


            Word.Document wdDoc = wdApp.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);


            wdApp.Selection.InlineShapes.AddPicture("c:\\background.gif", ref oMissing, ref oTrue, ref oMissing);


            object oFileName = "c:\\image.doc";


 


            wdDoc.SaveAs(ref oFileName, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,


                ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,


                ref oMissing, ref oMissing, ref oMissing);


 


            wdApp.Quit(ref oFalse, ref oMissing, ref oMissing);


 


        }


    }


}

Converting Doc or Xls file to GIF  Converting Doc or Xls file to GIF

10-Dec-09 03:12 AM
Hi Jack,
Your example is very helpfull for me.

But is there any way to convert doc/xls/docx to gif with C# programmetically as per your example.

Please help me asap.

Thanks.
Chandan
  senthil replied to Jack jack
27-Apr-10 11:28 AM
I want vice versa functionality. convert Microsoft word into image file..  is it possible without using third party tools ?
Thanks for your help
  himanshi replied to raymond hsu
11-Jul-11 03:28 PM
hey i'm facing the same problem..searching for the solution for the past 3 weeks.plzz mail me the solution if you get one...it's really imprtant 4 me.
thanx
  himanshi replied to raymond hsu
11-Jul-11 03:37 PM
hey i'm facing the same problem..searching for the solution for the past 3 weeks.plzz mail me the solution if you get one...it's really imprtant 4 me.
thanx
  Shahzad Latif replied to raymond hsu
18-Nov-11 12:27 AM
Hi Raymond,

You may try using http://www.aspose.com/categories/.net-components/aspose.total-for-.net/default.aspx which can help you convert Microsoft Office, PDF, and other documents to images very easily. These components are simple .NET assemblies which do not require MS Office, Adobe Acrobat or any other software to be installed on the development or deployment machines. It can work with any type of .NET application on 32-bit/64-bit systems. Please see the following blog post for further details on converting DOC/XLS/PPT/PDF and other file formats to images:

http://www.aspose.com/blogs/aspose-products/aspose-total-product-family/archive/2011/09/17/convert-microsoft-office-documents-and-other-file-formats-to-images-in-.net-applications.html

Disclosure: I work as a developer evangelist at Aspose.
Create New Account
help
Setup MS Office SharePoint 2007 Test / Dev Environment Authentication Problems Hello all, i like to setup a fast geöffnet werden. Fehler bei der Anmeldung.' Source: '.Net SqlClient Data Provider' Number: 4060 State: 1 Class: 11 Procedure: '' LineNumber: 65536 Server: 'd-it5-sptest-dc' 03 / 04 / 2010 13:53:11 Anmeldung für den Benutzer 'SPTEST \ spadmin'.' Source: '.Net SqlClient Data Provider' Number: 18456 State: 1 Class: 14 Procedure: '' LineNumber: 65536 Server: 'd-it5-sptest-dc' 03 / 04 / 2010 13:53:11 Überprüfen Sie die Konfigurationsdatenbank. Wird später wiederholt. 03 / 04 / 2010 13:53:17.73 Microsoft.Office.Server.Convers (0x0740) 0x0E04 Document Conversions Load Balancer Service 7jhf Medium RegisterLauncher called with uri http: / / D-IT5-SPTEST-DC:8082 / HtmlTrLauncher 03 / 04 / 2010 13:53:17.87 Microsoft.Office.Server.Convers (0x06D8) 0x0778 Document Conversions Launcher Service 7jdp Medium Registered Launcher with Load Balancer 03 / 04 / 2010 13:53:17.87 Microsoft.Office.Server.Convers (0x06D8) 0x0778 Document Conversions Launcher Service 7jdq Medium Testing output folder. 03 / 04 2010 13:53:17.94 Microsoft.Office.Server.Convers (0x06D8) 0x0778 Document Conversions Launcher Service 7jdr Medium Launcher booting complete. 03 / 04 54:15.42 OWSTIMER.EXE (0x0980) 0x0988 Windows SharePoint Services General 8dy9 High An Microsoft.Office.Server.Search.Administration.SearchDataAccessServiceInstance object is referencing the Microsoft.Office.Server.Search.Administration.SearchServerSkuType, Microsoft
7a4080d658ba42efa38ff6455cbc382b / BdcService.svc / http' Channel: 'Microsoft.SharePoint.BusinessData.SharedService.IBdcServiceApplication' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetLobSystemsLikeName' MessageId: 'urn:uuid:abbcffd4-6783-4121-86ca-a30f0afe866a' 5c243a60-f458-4953 32843 / 7a4080d658ba42efa38ff6455cbc382b / bdcservice.svc / http' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetLobSystemsLikeName' MessageId: 'urn:uuid:abbcffd4-6783-4121-86ca-a30f0afe866a' 5c243a60-f458-4953 7a4080d658ba42efa38ff6455cbc382b / BdcService.svc / http' Channel: 'Microsoft.SharePoint.BusinessData.SharedService.IBdcServiceApplication' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetLobSystemsLikeName' MessageId: 'urn:uuid:677d0349-b6d5-40e5-81b0-44215e75a07a' 5c243a60-f458-4953 32843 / 7a4080d658ba42efa38ff6455cbc382b / bdcservice.svc / http' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetLobSystemsLikeName' MessageId: 'urn:uuid:677d0349-b6d5-40e5-81b0-44215e75a07a' 5c243a60-f458-4953 7a4080d658ba42efa38ff6455cbc382b / BdcService.svc / http' Channel: 'Microsoft.SharePoint.BusinessData.SharedService.IBdcServiceApplication' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetLobSystemsLikeName' MessageId: 'urn:uuid:8be2a122-7adc-4a6a-a210-755f467427f0' 03cf2c53-b289-46d6 32843 / 7a4080d658ba42efa38ff6455cbc382b / bdcservice.svc / http' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetLobSystemsLikeName' MessageId: 'urn:uuid:8be2a122-7adc-4a6a-a210-755f467427f0' 03cf2c53-b289-46d6 7a4080d658ba42efa38ff6455cbc382b / BdcService.svc / http' Channel: 'Microsoft.SharePoint.BusinessData.SharedService.IBdcServiceApplication' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetEntityWithNameAndNamespace' MessageId: 'urn:uuid:153ef67d-de22-4526-bafa-139332dff5df' a05cf6c0-7fa6-4e4c 32843 / 7a4080d658ba42efa38ff6455cbc382b / bdcservice.svc / http' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http: / / www.microsoft.com / Office / 2009 / BusinessDataCatalog / BusinessDataCatalogSharedService / GetEntityWithNameAndNamespace' MessageId: 'urn:uuid:153ef67d-de22-4526-bafa-139332dff5df' a05cf6c0-7fa6-4e4c
and go to the web page that you want to convert to PDF. • Using the Adobe PDF toolbar menu, do one of the following: If you don’t see the Adobe PDF toolbar in Internet Explorer, choose View > Toolbars > Adobe PDF. • • To create a new PDF from the currently open web page, choose Convert Web the email message that opens after the conversion is complete. • SEE this link: http: / / help.adobe.com / en_US / Acrobat / 8.0 / Professional / help.html?content = WS58a04a822e3e50102bd615109794195ff-7f60.html • • • public string Run sFileName + " .pdf " + sFileName + " .html" ; pProcess.StartInfo.WorkingDirectory = m_sDrive + " :" + m_Directory; pProcess.Start(); return (sFileName + " .pdf" ); } The class PDFGenerator contains a public method called Run that will call the process hghtmldoc.exe with just that, displays the generated PDF file when ready. private void Page_Load( object sender, System.EventArgs e) { if ( Request.Params[ " File" ] ! = null ) { bool bRet = false ; int iTimeout = 0 ; while ( bRet = = false kind of file is downloading and ask you to SAVE or OPEN . If you have Adobe plug-in installed on your browser, you'll be able to see the PDF from your browser. Public Sub Page_Load(sender as Object, e as EventArgs) ' build the content for the dynamic Word document ' in HTML alongwith some Office specific style
having a problem to convert gif scanned images with the font of Coronet LTStd-Regular (Adobe) and i need it to be converted to note pad in times new roman so System.Drawing; using System.Text; using System.Windows.Forms; using Nevron.UI.WinForm.Controls; using Office = Microsoft.Office.Core; using Word = Microsoft.Office.Interop.Word; using System.Drawing.Imaging; namespace UITest { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load( object sender, EventArgs e) { } private void button1_Click( object sender, EventArgs e) { object oMissing = System.Reflection.Missing.Value; object