hummusrenderrer icon indicating copy to clipboard operation
hummusrenderrer copied to clipboard

Top alignment

Open raedle opened this issue 10 years ago • 1 comments

Hi.

I am a bit confused about the top alignment of boxes. When I use a top alignment of 10px for a box, it starts rendering the box at the bottom of a document (see red rectangle in image). Am I wrong when assuming that it should render the box at 10px starting from top of the document?

Great tool!! Thanks in advance!

{
    "source":{
        "external":"pdfFile"
    },
    "externals": {
        "anshika":"https://raw.githubusercontent.com/galkahana/hummusrenderrer/master/samples/img1.jpg",
        "pdfFile": "http://www.ca7.uscourts.gov/rules/type.pdf"
    },
    "pages": [
        {
            "modifiedFrom": 0,
            "width": 595,
            "height": 842,
            "boxes": [
                {
                    "top": 10,
                    "left": 100,
                    "image": {
                        "external":"anshika",
                        "transformation": [0.1, 0, 0, 0.1, 0, 0]
                    }
                }
            ]
        }
    ]
}

hummusrendering

raedle avatar Jan 27 '15 09:01 raedle

A little bit. Coordinates are bottom left oriented. You may specify the top ir bottom of the box but it will be relative to the bottom left corner of the page. Just substract the top that you are using from the page height to get the correct measure. Gal.

galkahana avatar Jan 27 '15 10:01 galkahana