modesty / modesty/pdf2json

Something is wrong with the text width calculation

Open
#426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2.2k
Forks
394
Avg merge
3d 5h
Merged PRs (30d)
7

Description

I am using pdf2json@4.0.3.

The x and y coordinates seems ok, but the w is a little large compared to the width of the page.

{
  "Width": 37.208,
  "Height": 52.62,
  "HLines": [],
  "VLines": [],
  "Fills": [],
  "Texts": [
    {
      "x": 11.181,
      "y": 6.631,
      "w": 228.612,
      "clr": 0,
      "sw": 0.36196875,
      "A": "left",
      "R": [
        {
          "T": "Intellectual Property Center, 28 Upper McKinley Rd.",
          "S": -1,
          "TS": [0,12.96,0,0]
        }
      ]
    },
    {
      "x": 8.369,
      "y": 7.343999999999999,
      "w": 318.272,
      "clr": 0,
      "sw": 0.36196875,
      "A": "left",
      "R": [
        {
          "T": "McKinley Hill Town Center, Fort Bonifacio, Taguig City 1634, Philippines",
          "S": -1,
          "TS": [0,12.96,0,0]
        }
      ]
    }
  ],
  "Fields": [],
  "Boxsets": []
}
Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report with pdf2json@4.0.3 using the supplied page dimensions, text strings, and reported x, y, and w values. Compare the calculated text widths with the page Width and the rendered result; done means the w values accurately represent the text width without changing the correct coordinates.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.