This is a migrated thread and some comments may be shown as answers.

Export pdf to excel file

1 Answer 514 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Julio
Top achievements
Rank 1
Julio asked on 28 Mar 2019, 12:23 PM

Dear all,

 

I am trying to export a PDF file to Excel file (.xlsx or xls). The PDF fiel contains some tables and i need to process them.

I am programing in vb .NET.

I have used FormatProviders, but it always export to PDF.

I can't find the option to export to Excel format.

Is it posible?

do you have an example?

The code I have used:

            Dim sampleFile As String = "C:\TEMP\RESERVA HIDRAULICA.pdf"
            Using stream As Stream = New FileStream(sampleFile, FileMode.Open, FileAccess.Read)
                     Dim document As Telerik.Windows.Documents.Fixed.Model.RadFixedDocument = New Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider().Import(stream)
                     Dim dialog As SaveFileDialog = New SaveFileDialog()
                     dialog.Filter = String.Format("{0} files|*.{1}", "xlsx", "Xlsx")
                     dialog.FileName = "Result.xlsx"
                     If dialog.ShowDialog() = DialogResult.OK Then
                           Using saveStream As Stream = dialog.OpenFile()
                                     Dim pdfFormatProvider As Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider = New Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider()
                                  pdfFormatProvider.Export(document, saveStream)
                                  End Using
                      End If
        End Using

 

Thanks a lot,

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 01 Apr 2019, 09:41 AM
Hello Julio,

The PdfProcessing library can convert the PDF documents to plain text. However, a conversion of PDF document to XLSX is not available. In case the export to text is an option for you, you can refer to the Using TextFormatProvider help topic for more details on how to use this functionality.

Hope this information is helpful.

Regards,
Tanya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Julio
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or