cancel
Showing results for 
Search instead for 
Did you mean: 

pdf to ms excel

suhasarigala
Level 2
Hi Everyone, I want to know how to convert pdf to ms excel by using blue prism

------------------------------
suhas arigala
------------------------------
10 REPLIES 10

SahilChankotra
Level 4
Hello Suhas,

You can use python code to convert PDF to CSV file.

------------------------------
Sahil Chankotra
------------------------------

Actually Sahil, I need to do PDF to CSV  using  blue prism only

------------------------------
suhas arigala
------------------------------

Hey Suhas,

If you can share more details like which PDF software you are using with BP to achieve conversion?
If it is Adobe Acrobat Pro DC, you can automate below steps:

  1. Click "File" > "Open" to upload your PDF file which you want to convert to CSV.
  2. Go to "Tools" > "Export PDF".
  3. Choose the format that you want to export your PDF
  4. Open the Excel file, go to "File" > "Save as", choose CSV as output format.
Hope this is useful.

Thanks.


------------------------------
Manish Kumar
SE
Sony India Software Centre
Asia/Colombo
------------------------------

Yes suhas you can use python Code in blue prism to convert PDF to CSV.

------------------------------
Sahil Chankotra
------------------------------

I believe this would be a good idea, there should be some code ready on the internet!!

------------------------------
Emerson Ferreira
Sr Business Analyst
Avanade Brasil
+55 (081) 98886-9544
If my answer helped you? Mark as useful!
------------------------------
Sr Cons at Avanade Brazil

Hi Emerson,

I worked in the python code stage which you can convert PDF to CSV file.

------------------------------
Sahil Chankotra
------------------------------

johan.m
Level 4
Hi,
I managed to make an action in BP using Adobe Pro DC and a VBS By Christos Samaras (https://myengineeringworld.net)

INPUT: 
PDFPath (text)
FileExtension (Text) ==> format to witch to convert (see code)
NewFilePath (text)

OUTPUT:
Message (text)

CODE:
Dim objAcroApp
Dim objAcroAVDoc
Dim objAcroPDDoc
Dim objJSO

Dim boResult
Dim ExportFormat

Try

If Not File.Exists(PDFPath) Then
Throw New ApplicationException("File not found: " & PDFPath)
End If

'Check the type of conversion.
Select Case LCase(FileExtension)
Case "eps": ExportFormat = "com.adobe.acrobat.eps"
Case "html", "htm": ExportFormat = "com.adobe.acrobat.html"
Case "jpeg", "jpg", "jpe": ExportFormat = "com.adobe.acrobat.jpeg"
Case "jpf", "jpx", "jp2", "j2k", "j2c", "jpc": ExportFormat = "com.adobe.acrobat.jp2k"
Case "docx": ExportFormat = "com.adobe.acrobat.docx"
Case "doc": ExportFormat = "com.adobe.acrobat.doc"
Case "png": ExportFormat = "com.adobe.acrobat.png"
Case "ps": ExportFormat = "com.adobe.acrobat.ps"
Case "rft": ExportFormat = "com.adobe.acrobat.rft"
Case "xlsx": ExportFormat = "com.adobe.acrobat.xlsx"
Case "xls": ExportFormat = "com.adobe.acrobat.spreadsheet"
Case "txt": ExportFormat = "com.adobe.acrobat.accesstext"
Case "tiff", "tif": ExportFormat = "com.adobe.acrobat.tiff"
Case "xml": ExportFormat = "com.adobe.acrobat.xml-1-00"
Case Else: ExportFormat = "Wrong Input"
End Select

'Check if the format is correct and there are no errors.
If ExportFormat <> "Wrong Input" And Err.Number = 0 Then

'Initialize Acrobat by creating App object.
objAcroApp = CreateObject("AcroExch.App")

'Set AVDoc object.
objAcroAVDoc = CreateObject("AcroExch.AVDoc")

'Open the PDF file.
If objAcroAVDoc.Open(PDFPath, "") Then

'the PDDoc object.
objAcroPDDoc = objAcroAVDoc.GetPDDoc

'Set the JS Object - Java Script Object.
objJSO = objAcroPDDoc.GetJSObject

'Save PDF file to the new format.
boResult = objJSO.SaveAs(NewFilePath & "." & FileExtension, ExportFormat)

'Close the PDF file without saving the changes.
boResult = objAcroAVDoc.Close(True)

Else
Throw New ApplicationException("Failed to open " & PDFPath)
End If

'Close the Acrobat application.
boResult = objAcroApp.Exit

Else
'Inform the user that something went wrong.
Throw New ApplicationException("The conversion of the following PDF file FAILED: " & PDFPath)

End If

Catch e As Exception
Message = e.Message

Finally
'Release the objects.
objAcroPDDoc = Nothing
objAcroAVDoc = Nothing
objAcroApp = Nothing
objJSO = Nothing

End Try

Hi Johan,

I am using BP version 6.2.1. I used the above code and getting an error message "Cannot create ActiveX component.". Do i need any specific DLL file required or need any settings before I try this action.

Thanks
Ashis

------------------------------
Ashis Kumar Ray
RPA Developer
TCS
Europe/London
------------------------------

Adobe Acrobat DC must be installed 🙂

------------------------------
Johan Michiels
Mr
BGL BNPP Luxembourg
------------------------------