I am transmitting a PDF to an MVC controller, saving the PDF to a database, and retrieving it. If I save the PDF to disk on the server side (prior to returning a file result), it looks fine. However, when I do something akin to the following:
return File(fileBytesFromDB, "application/pdf", "file.pdf");
I found it. One of my coworkers had added in a tokenizer as a decorator of return actions, and it was tokenizing the file stream. I added some logic to ignore
FileContentResult and now the PDFs come out okay.