Setasign / FPDI

FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF.
https://www.setasign.com/fpdi
MIT License
1.09k stars 159 forks source link

MIME Type #88

Closed reddingwebpro closed 5 years ago

reddingwebpro commented 5 years ago

I notice when outputting my PDF either via Output() or Output("I") the document properly displays on the screen both on a my PC and iOS device. However, when viewing the PDF on the iOS device it doesn't seem to realize that it's a PDF so it doesn't give the options to open-with or send-to PDF related applications. Then today while running the developer tools on Chrome on my PC, I noticed the following error when trying to view the generated PDF "Resource interpreted as Document but transferred with MIME type application/pdf". So it would seem that while FPDI is sending it with the correct MIME headers, for some reason Chrome (and apparently my iOS device both Safari and Chrome) are also seeing it as a "document" instead of a "PDF. Any clues as to the settings that need to be changed so that the browsers properly see the Outputted code as a real PDF instead of a generic Document type. Thanks.

JanSlabon commented 5 years ago

Jason, the Output() method is not part of FPDI but in the underlaying PDF library. E.g. FPDF or TCPDF. I saw a simliar issue in the FPDF forum some days ago but the initial author doesn't offer more information. Maybe you can hijack it. Just see here.

JanSlabon commented 5 years ago

Closed here. Discussion ended open here.