I would like to email a copy of a slide not show when button is pressed.
I have my results screen and after that if they have passed then it shows a certificate. I have the java to print this but want to be able to email a copy of the slide as PDF, or Jpeg.
It seems that there is no easy way to force to print the content as a PDF file. Users have to select the output format in the print windows then attach that PDF file in the email.
Here is a sample about email (or download) a copy of the slide as PNG.
In this sample, the first slide contains two text boxes for users input their name and their email address (which will be used to send email).
The second slide contains the certificate. Because of some technical limits, this slide should only contain images and texts. Please take a look at On Load event of this slide - here we add custom javascript code for download or send email action.
We use Google Script to send the email. You can see the sample code here:
Sending email from the learners’ email requires users authentication. The web app will send email on behalf of users so I don’t think that is a good idea.
Please follow this tutorial (find the Deploying a script as a web app section) https://developers.google.com/apps-script/guides/web to deploy your web app. After complete deploy, you will see your web app URL.
Then replace my web app URL by your web app URL in Slide 2 -> On Load -> Execute JavaScript
Is there any way to increase the text size on the resulting PNG from the default size (which appears to be about 10pt). The text appears too small on the merged PNG created by the web app.
Thanks for the response, Nam. I increased the size to 28 pts in AP, saved, and exported again. Formatted text looks great on the screen, but the change had no effect on the resulting merged PNG (see image below):
I forgot to mention that you have to select the learner name text caption then change the font size (just select the object then change format). Please don’t click inside the text caption to change the format.
Not sure what I’m doing wrong. I tried changing formatting only at the text caption object level, and same result. I am attaching a link to an excerpt of the project file with the two slides involved.
It seems to be a browser issue. The text size is correct in the merged PNG in Chrome but not in Firefox or Explorer. I can recommend that users access the module in Chrome; no problem.
So the only issue now is that I get a “Result: error” message when attempting to send the cert by email. I have copied your Code.gs exactly per your guidance above. Any suggestions?
Yes, you are right. The text size problem is related to browser compatibility. I’ve updated the code so now it can work with Chrome, Firefox or Edge.
It seems there is something wrong when you deploy the web app.
You should clone my code first. Then you have to deploy your web app with the following options to allow the web app can send email on behalf of you: