0
Good morning! I have a web application that creates a PDF file with the class FPDF. I price include a button that when clicked, open the applications installed on the device, for sharing the PDF file.
In case that button would only work on mobile devices:
However, the class I use offers me only 4 types of output, being them:
- Inline( opens the file in the browser);
- Direct dowload;
- Dowload with choice of directory;
- Return PDF as a string.
I use this class because it was the only one I found that is compatible with my PHP code.
The PDF is normally generated, but I don’t know how to share this file. I have tried several ways, but without success. Would anyone know how to do that? Or at least what I should research?
To share in other applications, the user’s browser has to be compatible. It is not with the server (php) that you will be able to do this. You will need to use javascript and depending on the browser version, and the device the user is using, it will not be possible. https://developers.google.com/web/updates/2016/09/navigator-share
– Andrei Coelho
With php you recover the link that will be used for the download. With javascript you share with other applications.... But, see, if the user is not using a mobile device, you need to use the API of social networks, email, etc that you want to share.
– Andrei Coelho