I have a javascript web app that generates PDFs client side in a user's browser (using pdfmake).
In mobile Safari a user can open this PDF and view it natively, but when they go to share it by email the message inserts the entire base64 encoded URL for the PDF into the email and it quickly becomes unwieldy.
What workaround do I need to do to stop it from doing that? Is there not some way to specify a default message (perhaps in some meta data) when a user goes to share a document by email?
Currently the user experience is unacceptable because a user has to delete the entire base64 URL before they send their message, which is several pages long.
I would rather not have to send the PDF to a server first to get a smaller URL.
Well, you could circumvent the browsers share by email, by providing your own, leveraging mailto: somewhere the user can see it...
Another idea, untested, is you could wrap the PDF in an iframe, then when the page is forwarded, the host page, not the PDF would be shared, this may require the use of a PDF viewer script, such as google's, something like:
<iframe src="https://docs.google.com/viewerng/viewer?url={{ URL to your PDF goes here }}&embedded=true" frameborder="0" height="100%" width="100%">
</iframe>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With