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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -