public async Task <IActionResult> CreateCertificateAsync(int invoiceId, [FromQuery] string language) { var stream = await _documentGenerationManager.CreateCertificateForDepositInvoiceAsync(invoiceId, language); var file = new FileStreamResult(stream, "application/pdf"); file.FileDownloadName = $"{invoiceId}_attest.pdf"; return(file); }