public function exportComparativeReportByYearPdfForApiRoute(ClientSurvey $client_survey, GetComparativeReportByYear $request): Response 	{ 		$locale = $request->comparative_language_by_year ?? DomainLanguages::getDefaultLanguage(); 		$client_survey->load(['survey.categories.questions.answers', 'applicants' => function ($query) { 			$query->available()->final(); 		}]);  		$matrix = $this->createMatrix($client_survey, $request, $locale); 		$this->prepareComparativeDataObject($client_survey, $request, $matrix, $locale);  		$this->comparativePdfService->canGenerateComparativeReport($client_survey, $this->comparativeDataObject->getApplicants(), $locale);  		$is_preview = !$request->boolean('download'); 		$view = $this->getComperativeReport($client_survey, $this->comparativeDataObject, $locale, $is_preview);  		$data = $this->chromePdfService->generatePdf($view->render()); 		$name = $client_survey->generateDownloadFileNameForComparativeReport($locale, 'download-file-name-comparative-report-by-year'); 		$showType = $is_preview ? 'inline' : 'attachment';  		$userActivityService = new UserActivityService($request); 		$userActivityService->createCustomEntry($client_survey, UserActivityType::Read);  		return response()->make($data, 200, [ 			'Content-Type' => 'application/pdf', 			'Content-Disposition' => "$showType; filename=$name", 		]); 	}