Dear
Spire.XLS for .NET is .NET Excel component which enables your .NET applications to fast generate, read, write and modify Excel document without Microsoft Office Excel Automation.
Download link : http://www.e-iceblue.com/Download/download-excel-for-net-now.html
Convert excel to Pdf.
[C#]
using Spire.Xls;
using Spire.Pdf;
using Spire.Xls.Converter;
namespace ExceltoPDF
{
class Program
{
static void Main(string[] args)
{
// load Excel file
Workbook workbook = new Workbook();
workbook.LoadFromFile("D:\\test.xlsx");
// Set PDF template
PdfDocument pdfDocument = new PdfDocument();
pdfDocument.PageSettings.Orientation = PdfPageOrientation.Landscape;
pdfDocument.PageSettings.Width = 970;
pdfDocument.PageSettings.Height = 850;
//Convert Excel to PDF using the template above
PdfConverter pdfConverter = new PdfConverter(workbook);
PdfConverterSettings settings = new PdfConverterSettings();
settings.TemplateDocument = pdfDocument;
pdfDocument = pdfConverter.Convert(settings);
// Save and preview PDF
pdfDocument.SaveToFile("sample.pdf");
System.Diagnostics.Process.Start("sample.pdf");
}
}
}
Link :
http://www.e-iceblue.com/Knowledgebase/Spire.XLS/Program-Guide/Convert-Excel-to-PDF-with-Spire.XLS.html
http://neevia.com/support/examples/cr/?get=ex003cnet
PDF to Excel using C# in asp.net
Code :
////////////////////////////////////////////////////////////////////////////////////////////////////
// This example was designed for using in Microsoft Visual C# from
// Microsoft Visual Studio 2003 or above.
//
// 1. Microsoft Excel 97 or above should be installed and activated on your PC.
//
// 2. Before using this example, please read this article from Microsoft Excel 2003 knowledge base:
// http://support.microsoft.com/kb/320369/en-us/
// A workaround for this issue is available in this example.
//
// 3. Universal Document Converter 5.2 or above should be installed, too.
//
// 4. Add references to "Microsoft Excel XX.0 Object Library" and "Universal Document Converter Type Library"
// using the Project | Add Reference menu > COM tab.
// XX is the Microsoft Office version installed on your computer.
////////////////////////////////////////////////////////////////////////////////////////////////////
using System;
using System.IO;
using UDC;
using Excel = Microsoft.Office.Interop.Excel; //using Excel; in VS2003
namespace ExcelToPDF
{
class Program
{
static void PrintExcelToPDF(string ExcelFilePath)
{
//Create a UDC object and get its interfaces
IUDC objUDC = new APIWrapper();
IUDCPrinter Printer = objUDC.get_Printers("Universal Document Converter");
IProfile Profile = Printer.Profile;
//Use Universal Document Converter API to change settings of converterd document
Profile.PageSetup.ResolutionX = 600;
Profile.PageSetup.ResolutionY = 600;
Profile.FileFormat.ActualFormat = FormatID.FMT_PDF;
Profile.FileFormat.PDF.ColorSpace = ColorSpaceID.CS_TRUECOLOR;
Profile.FileFormat.PDF.Multipage = MultipageModeID.MM_MULTI;
Profile.OutputLocation.Mode = LocationModeID.LM_PREDEFINED;
Profile.OutputLocation.FolderPath = @"c:\UDC Output Files";
Profile.OutputLocation.FileName = @"&[DocName(0)] -- &[Date(0)] -- &[Time(0)].&[ImageType]";
Profile.OutputLocation.OverwriteExistingFile = false;
Profile.PostProcessing.Mode = PostProcessingModeID.PP_OPEN_FOLDER;
//Create a Excel's Application object
Excel.Application ExcelApp = new Excel.ApplicationClass();
Object ReadOnly = true;
Object Missing = Type.Missing; //This will be passed when ever we don’t want to pass value
//If you run an English version of Excel on a computer with the regional settings are configured for a non-English language, you must set the CultureInfo prior calling Excel methods.
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
//Open the document from a file
Excel.Workbook Workbook = ExcelApp.Workbooks.Open(ExcelFilePath, Missing, ReadOnly, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing, Missing);
//Change active worksheet settings and print it
Excel.Worksheet Worksheet = (Excel.Worksheet)Workbook.ActiveSheet;
Excel.PageSetup PageSetup = Worksheet.PageSetup;
PageSetup.Orientation = Excel.XlPageOrientation.xlLandscape;
Object Preview = false;
Worksheet.PrintOut(Missing, Missing, Missing, Preview, "Universal Document Converter", Missing, Missing, Missing);
//Close the spreadsheet without saving changes
Object SaveChanges = false;
Workbook.Close(SaveChanges, Missing, Missing);
//Close Microsoft Excel
ExcelApp.Quit();
}
static void Main(string[] args)
{
string TestFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestFile.xls");
PrintExcelToPDF(TestFilePath);
}
}
}
Link :
http://bytescout.com/products/developer/pdfextractorsdk/convert-pdf-to-excel-csv
http://social.msdn.microsoft.com/Forums/vstudio/en-US/a56b093b-2854-4925-99d5-2d35078c7cd3/converting-pdf-file-into-excel-file-using-c
http://www.moretechtips.net/2013/01/how-to-convert-pdf-to-excel-in-net.html
Happy Coding.
If it helps you or directs U towards the solution,
MARK IT AS ANSWER
Webmasters964, if this helps please login to Mark As Answer. | Alert Moderator