I'm dynamically creating a PDF file using ABC PDF v8, then pushing that data to the screen using the File.ReadAllBytes
method, then displaying it using MVC5's FileStreamResult from my controller.
The problem is, one of the links on my PDF is a mailto containing a hyphen (email-example@mydomain.com
). This works exactly as intended when the physical PDF is created using ABC PDF, but when I grab the contents using File.ReadAllBytes
and return it to my controller to display in my browser (Chrome 44.0.2403.130 m) it strips out everything before the hyphen - leaving the email as just example@mydomain.com
.
EDIT:
Here's the code surrounding my File.ReadAllBytes:
string pdfPath = generateOrderPdf();
Byte[] pdf;
if (!string.IsNullOrEmpty(pdfPath) && File.Exists(pdfPath))
pdf = File.ReadAllBytes(pdfPath);
else
pdf = null;
cleanUp();
return pdf;
Another edit:
It looks like this is ONLY an issue displaying the PDF within Chrome - I think Chrome is modifying the mailto link behavior - this works fine in Internet Explorer.