Skip to content

Missing whitespace from cells #51

@TobiasGx

Description

@TobiasGx

Apologies in advance if this is a duplicate issue.

I need to parse a PDF document where some cells contain two separate numbers. See the image below:

Image

I used the following example code:


using (PdfDocument document = PdfDocument.Open("./document2.pdf", options))
{
    var page = ObjectExtractor.Extract(document, 1);
    var ea = new SpreadsheetExtractionAlgorithm();
    IReadOnlyList<Table> tables = ea.Extract(page); 
    var table = tables[0];
    var rows = table.Rows;
    using var streamWriter = new StreamWriter("./myjson.json");
    new JSONWriter().Write(streamWriter, table);
}

This produces the following (incorrect) result:

Image

When I use Camelot (Python) I get the following (correct) result:

Image

Is this a bug or am I doing something wrong?

A working solution in .NET would be ideal. I appreciate any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions