public async Task <IActionResult> OnPostPrint() { var theProcess = await ProcessDataAccess.GetHydratedProcess(ProcessIdSelection); var theCurrentRev = theProcess.Revisions.FirstOrDefault(i => i.RevStatusId == 1); //1 = LOCKED if (theCurrentRev == null) { await SetUpProperties(false, "Cannot create router for a process that does not have a LOCKED revision."); return(Page()); } PdfPath = PdfGenerator.GenerateRouterPdf(theProcess, theCurrentRev); FileStream fileStream = new FileStream(PdfPath, FileMode.Open, FileAccess.Read); FileStreamResult fsResult = new FileStreamResult(fileStream, MediaTypeNames.Application.Pdf); return(fsResult); }