public function generate(CoreExt_Controller_Page_Interface $instance)
 {
     header('Content-type: application/json');
     $instance->Gerar();
 }
 public function generate(CoreExt_Controller_Page_Interface $instance)
 {
     header('Content-type: application/json; charset=UTF-8');
     try {
         if ($this->canAcceptRequest()) {
             $instance->Gerar();
         }
     } catch (Exception $e) {
         $this->messenger->append('Exception: ' . $e->getMessage(), 'error', $encodeToUtf8 = true);
     }
     echo $this->prepareResponse();
 }