نکات کاربردی

طبقه بندی موضوعی

آخرین مطالب

۲ مطلب با کلمه‌ی کلیدی «pdf» ثبت شده است



Opening a pdf file directly in my browser


Instead of returning a File, try returning a FileStreamResult

public ActionResult GetPdf(string fileName)
{
    var fileStream = new FileStream("~/Content/files/" + fileName, 
                                     FileMode.Open,
                                     FileAccess.Read
                                   );
    var fsResult = new FileStreamResult(fileStream, "application/pdf");
    return fsResult;
}
behrad nasehi
۲۸ فروردين ۹۷ ، ۱۸:۵۴ موافقین ۰ مخالفین ۰ ۰ نظر

The Chrome browser (and FireFox and MS Edge) uses it's own PDF viewer. If you are running into problems with that viewer, with a file that renders correctly in Adobe Acrobat or the free Adobe Reader, the problem is in the browser software. You need to file a bug report about Chrome's PDF viewer with the Chrome development team. You can do this from within Chrome:

 

2017-11-29_11-38-08.png

https://forums.adobe.com/thread/2418709

https://github.com/mozilla/pdf.js/issues/6343


https://blog.idrsolutions.com/2013/07/ots-the-friendly-bouncer/

https://blog.idrsolutions.com/2013/04/tools-for-making-fonts-work-in-browsers/

Both Firefox and Chrome use a piece of open source code called the OpenType Sanitiser (OTS) which checks that fonts are properly formed (and a little more besides!) before passing them on to the font renderer.

Unlike Chrome, Firefox actually includes small reports on rejected fonts in its console. It only tells you which table was the reason for the rejection, but this is a good start!

behrad nasehi
۲۲ فروردين ۹۷ ، ۰۰:۱۴ موافقین ۰ مخالفین ۰ ۰ نظر