Skip to content

whsu00/pdf-reskeletonize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PDF Reskeletonize

Proof of concept for re-skeletonizing PDFs.

Requirements

Usage

python reskeletonize.py

  • outline.json specifies a list of template objects in the outline PDF, their x/y coordinates, and their width & height.
  • submission.json specifies a list of objects from the template that are present in the submission PDF, and their x/y coordinates.

Coordinates are all in inches, and the origin is at the bottom left of a page. PDF page numbers are 1-indexed (page 1 is the first page of a PDF).

Examples

Examples are generated with PyFPDF. PyFPDF sets the origin at the top left of a page.

Outline

Image of Outline

[
    {
        "id": "box1",
        "page": 1,
        "x": 0.5,
        "y": 7.5,
        "w": 7.5,
        "h": 3
    },
    {
        "id": "box2",
        "page": 1,
        "x": 0.5,
        "y": 4.5,
        "w": 7.5,
        "h": 3
    },
    {
        "id": "box3",
        "page": 1,
        "x": 0.5,
        "y": 1.5,
        "w": 7.5,
        "h": 3
    }
]

Submission

Image of Submission Image of Scanned Submission

[
    {
        "id": "box3",
        "page": 1,
        "x": 0.5,
        "y": 7.5
    },
    {
        "id": "box2",
        "page": 1,
        "x": 0.5,
        "y": 4.5
    }
]

Output (Reskeletonized)

Image of Output (Reskeletonized) Image of Scanned Output (Reskeletonized)

About

Proof of concept for re-skeletonizing PDFs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages