6

How might I copy or export a table from a PDF document into Word, Excel, OneNote, etc. as a table instead of plain text?

Example pdf: ftp://ftp2.cits.rncan.gc.ca/pub/canvec/doc/CanVec_transition_guide_en.pdf, starting at page 9. I'm using Office 2003, OneNote trial 2007.

  • How do you use the PDF Import Extension to copy the table? I can open the PDF document, but I can't select the table to copy it's contents, I can only select one cell at a time. – Sam Skuce Jul 18 '11 at 21:55
  • Update: the previous "integrated answer" has been removed. This question predated my understanding of how things work best in Stack Exchange communities. – matt wilkie Dec 13 '16 at 22:44
4

You might try Tabula - works pretty well for data oriented content placed in tables.

A short intro can be found on the homepage.

Using the tool for the PDF attached to this question you have to:

  1. Download the file to your local disk.
  2. Install and start the tool following the instructions on the homepage.
  3. Upload the PDF and select Submit.
  4. Navigate to the first table and select the table. Ensure that you do not select the header and footer of the page to get a more accurate result. Tabula - table selection
  5. Choose Repeat this selection if you want to select the following tables as well using the same coordinates.
  6. Choose Download all data and you get. Tabula - Extracted tabular data
  7. Choose Download data to get a CSV file with the extracted tables. This file can be opened with MS Excel or any other application which can read the CSV format for further processing.
| improve this answer | |
  • 1
    Can you maybe add some screenshots or step-by-step explanation of how to do this using the software you suggest? – MaQleod Apr 14 '14 at 15:33
  • Thanks. Worked OK, but didn't correctly detect table cells whose values were wrapped onto multiple lines. – Sam Mar 7 '17 at 8:03
6

You can use Okular document viewer available on Linux and Windows trough http://windows.kde.org/ installer.

It can select text as a table, where you can define rows and columns.

| improve this answer | |
5

MirzaD, thanks for suggesting Okular. I have it installed in my ubuntu desktop, and never took it seriously .. until now. Thanks to you.

Okular is awesome in the features it packs, and can certainly address the needs of the guy asking the question. With Okular, you use a Table Selection Tool and define an area, and then click in column borders to mark fields .. and then copy. When you paste it, you get a consistent tab-delimited output that any serious tool can be coaxed into handling as a CSV file.

I have this need (to extract a few tables from a PDF doc) now on a Centos desktop running gnome/xfce, and installing okular would mean installing a whole bunch of other KDE graphics tools. So, I will try first with tabula (which looks very promising too), and if that fails, then okular it would have to be.

Would this work for windows? Yes, KDE can be installed in windows, but KDE applications come with some decent overhead of other needless software .. So, it depends on how great your needs are, this may be a viable option for even windows.

Read more about Okular here .. and their slogan More Than a Reader certainly fits .. I am really impressed with what Okular can do .. in a neat and fast enough application with a small footprint.

KDE Windows project .. makes it easy to install a subset of excellent KDE apps in windows.

| improve this answer | |
2

Open the document with Adobe Acrobat. Click File > Save As. Select "HTML 4.01 with CSS 1.0 (*.htm, *.html)" in "Save as type", then save.

You can then open the saved HTML file in Microsoft Word, and it will be displayed as a table instead of plain text.

| improve this answer | |
  • 1
    This is a good answer for people who've purchased Acrobat. Any suggestions for those who don't have it? Save as other type is not available in Adobe Reader. – matt wilkie Jul 9 '10 at 15:58
  • 1
    For free alternatives, will OpenOffice show tables when opening a PDF document? – Arseni Mourzenko Jul 9 '10 at 20:20
2

www.freepdftoword.org - free online service. Does a reliable job of creating true tables objects in Word.

| improve this answer | |
  • Thanks. It worked perfectly using the default options and didn't have the extra row problem of the only other successful online converter. – matt wilkie Jul 9 '10 at 20:39
1

This is a tough one. If you have the means, the easiest solution is going to be contacting the person who made the PDF. Chances are they made it from a .doc file. If you can get the original, you have what you need with no conversion necessary.

| improve this answer | |
  • +1. By the way, copying content from a PDF document (and edit it?) may not be permitted if the document is copyrighted. So contacting the author is obviously the best solution. – Arseni Mourzenko Jul 9 '10 at 20:22
1

A related Q&A has been, apparently, deleted: https://stackoverflow.com/questions/488089/extracting-tables-from-pdf-files-programmatically/857800 (see cached version: http://webcache.googleusercontent.com/search?q=cache:9I328EN_d64J:stackoverflow.com/questions/488089/extracting-tables-from-pdf-files-programmatically/857800+&cd=1&hl=en&ct=clnk&gl=ch).

Below my answer, re-confirming that Okular is an excellent choice for a quick scrapping action.

For a quick (single-?)table extraction(s) it is worthy to check out Okular's excellent Table Selection Tool.

  1. Open the PDF file and locate the table in question
  2. activate the Table Selection Tool with Ctrl+5
  3. draw a rectangular area to enclose the table
  4. finally, and if required, define vertical and horizontal divisions of the table cells by clicking on edges (you might need to play a bit to get the idea -- see screenshot below).

A selection using Okular's Table Selection Tool

Voila! Copy and paste, for example, in an empty spreadsheet.

| improve this answer | |
0

I don't like adding extra software or sending my data offsite to an external site to convert it. Usually because of the time aspect!

But within PDF's you can select data in columns by holding down Alt and dragging, aslong as your table isn't huge (ie you'll have to do it for each column). Just copy and paste each into word.

Not ideal, but it works without having to install anything extra!

| improve this answer | |
0

I was able to succesfully copy table data via clipboard from Foxit PDF Reader directly into MS Word, Excel and Atlassian Conflunce.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.