Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def cr_cast(cr):
return cairocffi.Context._from_pointer(
cairocffi.ffi.cast("cairo_t **", id(cr) + object.__basicsize__)[0],
incref=True
)
def __init__(self, hdc):
pointer = cairo.cairo_win32_printing_surface_create(
ffi.cast('void*', hdc))
Surface.__init__(self, pointer)
def draw_page(self, operation, print_ctx, page_num, document):
page = document.pages[page_num]
cairo_context = print_ctx.get_cairo_context()
cairocffi_context = cairocffi.Context._from_pointer(
cairocffi.ffi.cast(
'cairo_t **', id(cairo_context) + object.__basicsize__)[0],
incref=True)
page.paint(cairocffi_context, left_x=0, top_y=-40, scale=0.75)