How to C#: Converter
Use Convert SDK for C#
Quick to Start
  |  
Home ›› XDoc.Converter ›› C# Converter: Quick to Start

C#: Start to Use XDoc.Converter SDK Library


Supports: Adobe PDF, MS Office Word, Excel, PowerPoint, Tiff, Dicom, and 100+ Image Formats







If you have already downloaded free tiral package of our XDoc.Converter for .NET and integrated needed DLL assemblies into your Visual Studio C# project. Then, you may have a test on its superior file conversion capabilities. To bigin with, we illustrate how to create a C# console application, and then implement fast conversion from PDF file to Microsoft Word file. Please see details as below.




How to Create a C# Console Application



Open Visual Studio (2005 or any above version), and click "New" from toolbar;


Select "C# Language" and "Console Application" respectively to create a project.




How to Convert Word to PDF in C# Console Application



Add necessary references to your C# project:


  RasterEdge.Imaging.Basic.dll


  RasterEdge.Imaging.Basic.Codec.dll


  RasterEdge.Imaging.DICOM.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.JBIG2.dll


  RasterEdge.Imaging.JPEG2000.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Converter.dll


  RasterEdge.XDoc.Excel.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.XDoc.PDF.dll


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XDoc.TIFF.dll


  RasterEdge.XDoc.Word.dll


  RasterEdge.XImage.AdvancedCleanup.Core.dll


  RasterEdge.XImage.OCR.dll


  RasterEdge.XImage.OCR.Tesseract.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use the namespaces


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.Converter;


Add following C# demo code to your console application.




// Define input and output files path.
String inputFilePath = @"***.docx";
String outputFilePath = @"***.pdf";

// Convert Word to PDF and show conversion result.
ConvertResult result = DocumentConverter.ToDocument(inputFilePath, outputFilePath, FileType.DOC_PDF);
switch (result)
{
        case ConvertResult.NO_ERROR:
                Console.WriteLine("Success");
                break;
        case ConvertResult.FILE_TYPE_UNSUPPORT:
                Console.WriteLine("Fail: can not convert to PDF, file type unsupport");
                break;
        case ConvertResult.FILE_TYPE_UNMATCH:
                Console.WriteLine("Fail: input file is not a document");
        default:
                Console.WriteLine("Fail: unknown error");
                break;
}