Export pdf to excel file

2 posts, 0 answers
  1. Julio
    Julio avatar
    1 posts
    Member since:
    Mar 2019

    Posted 28 Mar Link to this post

    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,

  2. Tanya
    Admin
    Tanya avatar
    836 posts

    Posted 01 Apr Link to this post

    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.
Back to Top