XDoc.Converter
Features
Tech Specs
How-to C#
Pricing

C# Document Converter Library
C# PDF Convert: How to Convert Office Excel to Adobe PDF


Support Fast Conversion from MS Office Excel to Adobe PDF Document





RasterEdge XDco.Converter for .NET supports conversion between Office Excel and Adobe PDF. Here, we will provide Visual C# sample code for PDF conversion from Excel document. Microsoft Office Excel 2003, 2007 and later versions are all supported by our converter SDK.


C# Demo: PDF Conversion from Excel



PDF conversion from Microsoft Excel can be easily accomplished with the help of following C# demo. Please note that, the document page/sheet size will keep unchanged for conversion among documents.

// Used to register all DLL assemblies.
WorkRegistry.Reset();

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

// Convert Excel 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;
}