func (pdf *PDF) GetLastError() error { defer C.HPDF_ResetError(pdf.doc) if err := C.HPDF_GetError(pdf.doc); err != C.HPDF_OK { detail := C.HPDF_GetErrorDetail(pdf.doc) return NewError(err, detail) } return nil }
func New() (*PDF, error) { doc := C.HPDF_New(nil, nil) if err := C.HPDF_GetError(doc); err != C.HPDF_OK { return nil, NewError(err, 0) } pdf := &PDF{doc} runtime.SetFinalizer(pdf, finalizePDF) return pdf, nil }