Forum Discussion

Amiregent's avatar
Amiregent
New Member
10 years ago
Solved

PDFs as a data source

Would anyone have suggestions as to how one could extract data from PDF pages which can then be used in Power BI?

  • Amiregent,

     

    There's currently no solution to import PDF data into Power BI Desktop. This data source is in our radar, as we have received some requests in the past, but we don't have any immediate plans to add it to the product.

     

    If this is an important feature for you, please leave a vote for it in our UserVoice Feature Suggestions forum. Please also leave a description about the type of data that you need to extract from the PDF document. For instance, are you trying to extract one/multiple tables from the document, or plain text?

     

    Thanks,
    M.

23 Replies

  • mike_honey's avatar
    mike_honey
    Memorable Member

    Word 2013+ can open PDF files and does a reasonable job of interpreting their tables etc.  From there I would copy and paste the data into an Excel file get a consistent set of rows and columns.  Whole tables should come across quite easily.

     

    If this was a regular requirement, you could probably record/write a Word macro (VBA) to automate the steps.

  • mllopis's avatar
    mllopis
    Community Admin

    Amiregent,

     

    There's currently no solution to import PDF data into Power BI Desktop. This data source is in our radar, as we have received some requests in the past, but we don't have any immediate plans to add it to the product.

     

    If this is an important feature for you, please leave a vote for it in our UserVoice Feature Suggestions forum. Please also leave a description about the type of data that you need to extract from the PDF document. For instance, are you trying to extract one/multiple tables from the document, or plain text?

     

    Thanks,
    M.

  • Jim_Philips's avatar
    Jim_Philips
    Frequent Visitor

    A VBA procedure to extract information from the PDF would normally be ideal for a recurring process, such as a PDF file published once a month with new information.  Point the procedure at the new or changed PDF file and push the button again and your Excel tables are refreshed with the new information.

     

    The VBA solution I am suggesting here does not involve copy and paste and it does not involve converting your PDF file to Word or Excel first.  The conversion of your PDF to Word or Excel may work for some files that are not large or complex, but the process will likely be slower than the VBA solution that reads the file and extracts the appropriate information to write to your Excel workbook.  I have used the VBA read and extract solution on PDF files as large as 70M and 22,000 pages, writing 3-4 thousand rows to an Excel table.

     

    If you need such a solution, contact me.

    • sharmv's avatar
      sharmv
      Regular Visitor

      Hello Jim.  We need a solution to pull in a PDF document from a website on a recurring basis and import to Power BI.

       

      Can you please provide further details on the VBA solution can help?

       

      Thanks.

      • Jim_Philips's avatar
        Jim_Philips
        Frequent Visitor

        As I mentioned in my reply to your Private Message, if I can get a copy of the PDF file and a good description of the information you would like to extract from it to Excel, I could provide a detailed response. 

  • fso's avatar
    fso
    Advocate II

    I have never seen a PDF used as a data source - in any BI tool I have used so far.
    PDFs are not a reasonable format for data.
    If possible, you need to get the data in a different format (csv, json, xml, etc.)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Amiregent Is this a one time action, or do you need to extract the information as part of a reoccuring process?

    • Treehouse1234's avatar
      Treehouse1234
      New Member

      Recurring process would be of the most use. point to the site and refresh with any updates, changes, modificaitons, etc.

  • Jim_Philips's avatar
    Jim_Philips
    Frequent Visitor

    It is possible to write a VBA procedure to read a PDF file and write selected information to your Excel workbook.  With the procedure written, you could create entire tables in Excel from your PDF at the push of a button.  Once the information is in Excel, it is available to Power BI.

     

    The type of VBA procedure I have in mind requires you to have, in addition to Excel, Acrobat regular or pro (not Acrobat Reader).

     

    The difficulty of writing the VBA procedure will vary with the PDF file and the information you are wanting to extract from it.

  • I would recommend using the Apache tika program to create a text file for parsing. 

     

    Sample syntax is simply:

     

    python tika.py parse text filename.pdf

     

     

  • Extracting table data from PDF documents can be really tricky. For example if a table spans over several pages or if your PDF file is actually a scanned images. There are however PDF Parser solutions on the market which can batch convert PDF to Excel. One I know of is called Docparser.