Convert Pdf To Excel SolidFramework.dll

  • Thread starter Thread starter Aydogann
  • Start date Start date
A

Aydogann

Guest
Hello there,

I want to make an application that converts the pdf file to excel with SolidFramework.dll but I get the error


Error:

Severity Code Description Project File Line Suppression State
Error CS5001 Program does not contain a static 'Main' method suitable for an entry point ConsoleApplication1 C:\Users\aydogan.ilhan\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApplication1\CSC 1 Active


Codes:

using System;
using SolidFramework.Converters;
using SolidFramework.Converters.Plumbing;

namespace CSharp_Tutorials
{
public static partial class Tutorials
{
public static bool ConvertPdfToExcel(string pdfPath, string outputPath)
{
// Create a PdfToExcelConverter
using (var converter = new PdfToExcelConverter())
{
// Add the PDF file to convert
converter.AddSourceFile(pdfPath);

// Optional: Set PdfToExcelConverter options to your liking
converter.SingleTable = ExcelTablesOnSheet.PlaceEachTableOnOwnSheet;
converter.KeepNonTableContent = false;
converter.DetectTiledPages = true;

// Optional: Add a progress/warning handler
double nextPercentToLog = 25;
converter.Progress += (sender, progress) =>
{
double percent = progress.Progress * 100.0 / progress.MaxProgress;
if (percent < nextPercentToLog || (percent > 70 && nextPercentToLog < 30)) { return; }
Console.WriteLine(progress.StatusDescription + " " + percent + "%");
nextPercentToLog = percent > 70 ? 25 : nextPercentToLog + 25;
};

Console.WriteLine("Converting " + pdfPath + " to " + outputPath);

// Convert the file
var result = converter.ConvertTo(outputPath, true);

// Check if it was successful
if (result != ConversionStatus.Success)
{
Console.WriteLine("Converting " + pdfPath + " to " + outputPath + " failed with status: " + result);
Console.WriteLine();
return false;
}
}
Console.WriteLine("Successfully converted " + pdfPath + " to " + outputPath);
Console.WriteLine();
return true;
}
}
}

Continue reading...
 
Back
Top