PdfFocusCExcelOptionsConvertNonTabularDataToSpreadsheet Property |
Convert even a textual data to a table. Default value: true.
Namespace: SautinSoftAssembly: SautinSoft.PdfFocus (in SautinSoft.PdfFocus.dll) Version: 2024.9.26
Syntax public bool ConvertNonTabularDataToSpreadsheet { get; set; }
Public Property ConvertNonTabularDataToSpreadsheet As Boolean
Get
Set
Property Value
BooleanExample How to convert only tables PDF to Excel and skip all textual data using C#
using System;
using System.IO;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
string pathToPdf = Path.GetFullPath(@"..\..\..\Table.pdf");
string pathToExcel = "Result.xlsx";
SautinSoft.PdfFocus f = new SautinSoft.PdfFocus();
f.ExcelOptions.Format = SautinSoft.PdfFocus.Format.Xlsx;
f.ExcelOptions.ConvertNonTabularDataToSpreadsheet = false;
f.ExcelOptions.PreservePageLayout = true;
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US");
ci.NumberFormat.NumberDecimalSeparator = ",";
ci.NumberFormat.NumberGroupSeparator = ".";
f.ExcelOptions.CultureInfo = ci;
f.OpenPdf(pathToPdf);
if (f.PageCount > 0)
{
int result = f.ToExcel(pathToExcel);
if (result==0)
{
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(pathToExcel) { UseShellExecute = true });
}
}
}
}
}
How to convert only tables PDF to Excel and skip all textual data using VB.Net
Imports System.IO
Imports System.Drawing.Imaging
Imports System.Collections.Generic
Imports SautinSoft
Module Sample
Sub Main()
Dim pathToPdf As String = Path.GetFullPath("..\..\..\Table.pdf")
Dim pathToExcel As String = "Result.xlsx"
Dim f As New SautinSoft.PdfFocus()
f.ExcelOptions.Format = SautinSoft.PdfFocus.Format.Xlsx
f.ExcelOptions.ConvertNonTabularDataToSpreadsheet = False
f.ExcelOptions.PreservePageLayout = True
Dim ci As New System.Globalization.CultureInfo("en-US")
ci.NumberFormat.NumberDecimalSeparator = ","
ci.NumberFormat.NumberGroupSeparator = "."
f.ExcelOptions.CultureInfo = ci
f.OpenPdf(pathToPdf)
If f.PageCount > 0 Then
Dim result As Integer = f.ToExcel(pathToExcel)
If result = 0 Then
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(pathToExcel) With {.UseShellExecute = True})
End If
End If
End Sub
End Module
See Also