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

"Send mail" to support PDF option #1425

Open
fluzzywuzzy opened this issue May 5, 2021 · 3 comments
Open

"Send mail" to support PDF option #1425

fluzzywuzzy opened this issue May 5, 2021 · 3 comments

Comments

@fluzzywuzzy
Copy link

Feature request

A client of mine requested that their mpdf generated PDF form should have the "Send email" functionality on a button at the bottom of the page. We got it mostly working the way the client wants, setting up a form with action set to mailto:, and a simple submit button. However, the client needs to have the PDF sent as a PDF in the current state, and it seems it's only possible to send the form data in XFDF format.

There is an option for this in Acrobat for example, I can edit the button generated from MPDF to send a PDF instead, so in my mind it's just passing some setting to the PDF via a MPDF setup, or some value on the form and/or submit button.

If this feature is allready available, please point me in the right direction.

@finwe
Copy link
Member

finwe commented May 5, 2021

I am not sure I understand correctly. You want to somehow send an e-mail from inside the mPDF generated file? Can you point me to a source that describes it/does it?

@fluzzywuzzy
Copy link
Author

fluzzywuzzy commented May 5, 2021

Exactly. PDF's have a "Send email" function, I can trigger it by creating a form in the PDF, and having the action set to "mailto:".
I just want it to send it in another format, it's easy to change the format if I edit the PDF in acrobat, but I can't figure out if it's possible to change at generation from MPDF.

Here's a MPDF generated PDF example that uses this function. The button saying "Skicka mail"
REGULAR-20210505_1041.pdf
Try pressing it in Acrobat reader, and it should suggest you to pick a mail-service, etc. for sending it.

The HTML in the file generating this PDF is a bit long, but this function is basically just a form setup like this

<form action="mailto:" method="post">
    <input type="text" name="input1" value="Fri text">
    <input type="submit" value="Skicka mail" />
</form>

There's a problem with the submit button-text not being visible in chrome, but ignore that.

The only behaviour I would like to change, is the setting that tells the PDF to send XFDF data. As of right now, everything seems to be working, but I can't tell it to instead send the PDF. Basically this setting in Acrobat, I would like to be able to set in MPDF.
image

Does this make the feature request more clear, or do you need something more/other to make sense of it? Sorry If I'm not the best at explaining it...

@lems3
Copy link

lems3 commented Mar 10, 2023

You can do it in Javascript :

<input type="button" name="javascriptButton" value="Javascript Button" onClick="
    this.submitForm({ cURL: 'mailto:email@example.com', cSubmitAs: 'PDF' });
" />

It won't work in the Chrome preview, but I think it's a Chrome issue, not a mPDF issue.

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

No branches or pull requests

3 participants