Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant open generated file in chrome android and ios devices #159

Closed
codieslabdev opened this issue Dec 8, 2022 · 2 comments
Closed

Cant open generated file in chrome android and ios devices #159

codieslabdev opened this issue Dec 8, 2022 · 2 comments

Comments

@codieslabdev
Copy link

I notice when outputting my PDF either via Output() or Output("I") the document properly displays on the screen both on 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
Copy link
Member

Do you have the same behavior if you execute one of the official tutorials from FPDF: http://fpdf.org/en/tutorial/index.php ?

This is not really magic and I don't think that this code is wrong (it is there for more than a decade): https://github.com/Setasign/FPDF/blob/master/fpdf.php#L1007

Maybe you mix other response headers?

@JanSlabon
Copy link
Member

Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants