/**
  * Get Single page detail
  *
  * @param $id
  * @param $page_no
  * @return \Illuminate\View\View
  */
 public function pageDetail($id, $page_no)
 {
     $contract = new \stdClass();
     $contract->page = $this->api->getTextPage($id, $page_no);
     $contract->annotations = $this->api->getAnnotationPage($id, $page_no);
     $contract->metadata = $this->api->getMetadata($id);
     if (is_null($contract->metadata)) {
         return abort(404);
     }
     return view('contract.page.detail', compact('page', 'contract', 'annotations'));
 }
 /**
  * Get Annotations
  * @param  $contractId
  * @return json
  */
 public function annotations()
 {
     if ($this->request->has('contract')) {
         $contract_id = $this->request->input('contract');
     } else {
         $contract_id = $this->request->input('id');
     }
     $response = $this->api->getAnnotationPage($contract_id, $this->request->input('document_page_no'));
     $response['rows'] = $response['result'];
     return response()->json($response);
 }