# PDF to Excel Conversion

**URL:** <https://forum.electroneek.com/t/pdf-to-excel-conversion/3325>\
**Category:** Studio Pro\
**Created:** [May 3, 2023, 10:58am UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325 "2023-05-03T10:58:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muhammad\_Hayyan](https://forum.electroneek.com/user_avatar/forum.electroneek.com/muhammad_hayyan/32/1746_2.png) [@Muhammad\_Hayyan](https://forum.electroneek.com/u/Muhammad_Hayyan)\
**Post date:** [May 3, 2023, 10:58am UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325/1 "2023-05-03T10:58:06Z")

</div>

Hi!

I have a query. I want your help.

I want to add the data from PDF file to excel sheet. The data is in the form of table in PDF and I want it to store in excel.

My flow:

I am reading PDF file storing it in a variable, passing it to excel sheet. It is giving me error of “” Invalid array format “”. Then I tried converting PDF data stored in a variable to string using command .toString and then passing it to excel sheet but it is giving me error “Selectors: Error converting value “Hayyan Khan khaann Ali Khan khann Hamza anwar Malik Shahan Saeed khan” to type ‘System.Collections.Generic.IDictionary`2[System.String,System.Collections.Generic.IDictionary`2[System.String,System.String]]’. Path ‘’, line 1, position 80… If the issue persists, please refer to Help Center to make sure the activity ‘Save table’ was set up correctly.”

The data I have in PDF

 ![image](https://forum.electroneek.com/uploads/default/original/2X/f/fe933b668ec39742aeb00d66bd693fcbb2b6bad1.png)

I hope you get my scenario. Waiting for your feedback?  
**NOTE** : I don’t want to use any 3rd party app for it.

Thank you!

Best Regards,  
Muhammad Hayyan Khan

---

<div class="post-metadata">

**Author:** ![Kudlappa\_Gouder](https://forum.electroneek.com/user_avatar/forum.electroneek.com/kudlappa_gouder/32/371_2.png) [@Kudlappa\_Gouder](https://forum.electroneek.com/u/Kudlappa_Gouder)\
**Post date:** [May 4, 2023, 3:46pm UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325/2 "2023-05-04T15:46:33Z")

</div>

@Muhammad_Hayyan The input you are passing to excel might not correct.  
for example: if you are using write excel file activity then value must be in below format  
{  
“My List”: [  
{  
“Country”: “Russia”,  
“Capital”: “Moscow”  
},  
{  
“Country”: “USA”,  
“Capital”: “Washington DC”  
}  
]  
}

please refer this article: [Write Excel File – ElectroNeek Help Center](https://help.electroneek.com/hc/en-us/articles/360019732657-Write-Excel-File)

---

<div class="post-metadata">

**Author:** ![Muhammad\_Hayyan](https://forum.electroneek.com/user_avatar/forum.electroneek.com/muhammad_hayyan/32/1746_2.png) [@Muhammad\_Hayyan](https://forum.electroneek.com/u/Muhammad_Hayyan)\
**Post date:** [May 6, 2023, 9:36pm UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325/3 "2023-05-06T21:36:31Z")

</div>

No! I am following the same format. Thank you anyways! 😊

---

<div class="post-metadata">

**Author:** ![Kudlappa\_Gouder](https://forum.electroneek.com/user_avatar/forum.electroneek.com/kudlappa_gouder/32/371_2.png) [@Kudlappa\_Gouder](https://forum.electroneek.com/u/Kudlappa_Gouder)\
**Post date:** [May 8, 2023, 8:08am UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325/4 "2023-05-08T08:08:03Z")

</div>

@Muhammad_Hayyan **I am reading PDF file storing it in a variable** : Which activity you are using to read pdf? could you send the value of this variable?

Also, you can use Intellidocs to extract table data from PDF which is the easiest way to do it. Please refer below article for more information about intellidocs

> **[IntelliDocs - Overview](https://help.electroneek.com/hc/en-us/articles/8257597523101-IntelliDocs-Overview)**
>
> What is IntelliDocs?
> IntelliDocs is a tool you can use to process documents without having to program your own platform. As a Managed Service Provider (MPS), you can quickly apply Intelligent Docum...

---

<div class="post-metadata">

**Author:** ![Muhammad\_Hayyan](https://forum.electroneek.com/user_avatar/forum.electroneek.com/muhammad_hayyan/32/1746_2.png) [@Muhammad\_Hayyan](https://forum.electroneek.com/u/Muhammad_Hayyan)\
**Post date:** [May 12, 2023, 4:33am UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325/5 "2023-05-12T04:33:40Z")

</div>

Yes! I have tried using intellidocs. But it will be quite expensive solution.

---

<div class="post-metadata">

**Author:** ![cris-dsc](https://forum.electroneek.com/user_avatar/forum.electroneek.com/cris-dsc/32/768_2.png) [@cris-dsc](https://forum.electroneek.com/u/cris-dsc)\
**Post date:** [May 12, 2023, 9:21pm UTC](https://forum.electroneek.com/t/pdf-to-excel-conversion/3325/6 "2023-05-12T21:21:25Z")

</div>

I think I’ve found a solution. For this to work, the excel file must already exist.

PDF input:

 ![image](https://forum.electroneek.com/uploads/default/original/2X/3/381254d52adc48f90f092688e718b049bfa945ef.png)

Workflow:

 ![image](https://forum.electroneek.com/uploads/default/original/2X/5/5609db85a910fab2dfc166b6385a2a3078950738.png)

Excel output:  
 ![image](https://forum.electroneek.com/uploads/default/original/2X/7/78bb32cf51a2d3fc8b9eb4b75a8e8f8baa75ea3e.png)

Convert `pdf_content` into an array (which I called `array`) using `split()` to get rid of “\r\n” and then `map()` with `split()` again to get rid of spaces:

`pdf_content.split("\r\n").map(function(row){return row.split(' ');});`

Then add a counter `i` to control the loop based on the length of `array` and use it to append each `array` item into the excel sheet as a new row.
