func NewPDFSurface(filename string, widthInPoints, heightInPoints float64, version PDFVersion) *Surface { cs := C.CString(filename) defer C.free(unsafe.Pointer(cs)) s := C.cairo_pdf_surface_create(cs, C.double(widthInPoints), C.double(heightInPoints)) C.cairo_pdf_surface_restrict_to_version(s, C.cairo_pdf_version_t(version)) return &Surface{surface: s, context: C.cairo_create(s)} }
//RestrictTo restricts the generated PDF to the specified verison. // //This method should only be called before any drawing operations have been //performed on this surface. // //Originally cairo_pdf_surface_restrict_to_version. func (s Surface) RestrictTo(v version) error { C.cairo_pdf_surface_restrict_to_version(s.XtensionRaw(), C.cairo_pdf_version_t(v)) return s.Err() }