Create pdf and share for installed applications

Asked

Viewed 29 times

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:

Gostaria de algo parecido com isso

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?

  • 1

    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

  • 1

    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.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.