osx - Dealing with NSRect in python -
i have function:
def getmediabox(doc, pagenum): page = cgpdfdocumentgetpage(doc, pagenum) return cgpdfpagegetboxrect(page, kcgpdfmediabox)
which returns:
<nsrect origin=<nspoint x=0.0 y=0.0> size=<nssize width=499.0 height=709.0>>
is data type python can with? <> brackets mean? ideally, want query , test size numbers.
interestingly, coregraphics seems accept nested lists, [[0,0],[499,709]] when expects nsrect.
many thanks: appreciated.
you can query nsrect object following lines:
x = cgrectgetwidth(mediabox) y = cgrectgetheight(mediabox)
Comments
Post a Comment