Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Jul 07, 2023 3:01 am

Hi..

I have a PDF file saved as a PDF file from an Excel file.

If I try to extract table from this PDF file with `PdfTableExtractor`, number of tables on that page is not recognized as 0.

So,
I tried to compose a table by extracting text and using csv separators,
but the space between each cell is filled with simple blank characters.

Since using `split` with the blank is not recommended, I couldn't use this either.

When an Excel file such as an attachment is saved as a PDF, is there a way to read the PDF and extract it a table?

Sungkyu_min
 
Posts: 36
Joined: Fri Jan 07, 2022 5:53 am

Fri Jul 07, 2023 7:04 am

Hello,

Thank you for your inquiry.
Please note that PDF files themselves do not inherently have a concept of tables. When extracting tables using Spire.PDF, we first identify horizontal and vertical lines within the pages. If multiple lines intersect, we consider it to be a "table" and the areas between adjacent vertical and horizontal lines are treated as "cells". Therefore, the extraction of table content relies on these intersecting lines.
However, when I tested your Excel file and converted it to a PDF, there were no intersecting horizontal and vertical lines present. This is the reason why the "Number of Tables on the Page" value is 0. If you wish to extract tables successfully after converting an Excel file to a PDF, please ensure that the cell borders are properly defined, as shown in the attached document.
If you have any further questions or require assistance, please feel free to let us know.

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Fri Jul 07, 2023 8:13 am

Hi..
Thank you for the information.

In the real PDF file I'm trying to extract as a table, there are exist horizontal lines.
But the vertical line doesn't exist.

The PDF file is provided by someone, and I cannot edit it.
I was expecting to work easily with Spire.PDF, but I think it is difficult.
Thanks for let me know how the PDF file recognizes the cells.

Sungkyu_min
 
Posts: 36
Joined: Fri Jan 07, 2022 5:53 am

Fri Jul 07, 2023 9:15 am

Hello,

You're welcome.
If you encounter other issues related to our products in the future, please feel free to contact us.
Have a nice day!

Sincerely,
Wenly
E-iceblue support team
User avatar

Wenly.Zhang
 
Posts: 149
Joined: Tue May 16, 2023 2:19 am

Return to Spire.PDF