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 Dec 20, 2024 7:07 pm

Since it's been a while since we corresponded and I saw there's a new version of Spire.PDF out, has there been any progress on this bug?

jsrcastrogiovanni
 
Posts: 18
Joined: Thu Aug 22, 2024 6:02 pm

Mon Dec 23, 2024 7:16 am

Hello,

Thanks for your following up. Now, Our developers have adjusted the code for bug SPIREPDF-7026 and it is currently in the testing phase. Meanwhile, I have urged the testing personnel to complete the test as soon as possible. Once the test is passed, we will provide you with a hotfix version as soon as possible. Thank you for your patience.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 306
Joined: Mon Jul 15, 2024 5:40 am

Tue Dec 31, 2024 9:23 am

Hello,

Thank you for your patience.
Glad to inform that we just released Spire.Pdf for Java 10.12.10 which fixed the issue of failed extraction of vertical text in the table, welcome to download it from the following link and test it. However, the content shown in the figure below may still be lost because the characters used in this part of the content do not correspond to valid Unicode characters. Therefore, even if Adobe software is used for copying, it will still result in content loss. Our developers will further fix it, and once this issue is resolved, we will notify you immediately. Thank you for your understanding.

link:https://www.e-iceblue.com/Download/pdf-for-java.html

Test code:
Code: Select all
PdfDocument pdf = new PdfDocument();
        pdf.loadFromFile("Test Report.pdf");
        StringBuilder builder = new StringBuilder();

        //Create an object of the PdfTableExtractor class
        PdfTableExtractor extractor = new PdfTableExtractor(pdf);
        //Traverse every page
        for (int page = 0; page < pdf.getPages().getCount(); page++)
        {
            //Extract tables from the page and store them in the PdfTable[]
            PdfTable[] tableLists = extractor.extractTable(page);
            if (tableLists != null && tableLists.length > 0)
            {
                //Traverse the table
                for (PdfTable table : tableLists)
                {
                    //Retrieve table rows
                    int row = table.getRowCount();
                    //Retrieve table columns
                    int column = table.getColumnCount();
                    for (int i = 0; i < row; i++)
                    {
                        for (int j = 0; j < column; j++)
                        {
                            //Retrieve the text content from the table
                            String text = table.getText(i, j);
                            builder.append(text+" ");
                        }
                        builder.append("\r\n");
                    }
                }
            }
        }

        //Save as txt
        FileWriter fileWriter = new FileWriter("ExtractedTable.txt");
        fileWriter.write(builder.toString());
        fileWriter.flush();
        fileWriter.close();
User avatar

Amin.Gan
 
Posts: 306
Joined: Mon Jul 15, 2024 5:40 am

Return to Spire.PDF

cron