Send response pdf in email

More
3 weeks 6 days ago - 3 weeks 6 days ago #191114 by DenisChenu
Print your answers. is a global LimeSurvey option. You can choose to replace the action by downloding the related PDF

Also, I assume the emails are only sent if the survey is active : ALL is done ONLY when survey is active, the system can not create a file without a response table.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: 3 weeks 6 days ago by DenisChenu.
The following user(s) said Thank You: rickanderson

Please Log in or Create an account to join the conversation.

More
3 weeks 6 days ago #191118 by rickanderson
Thanks Denis...much appreciated!

Please Log in or Create an account to join the conversation.

More
3 weeks 1 day ago #191274 by rickanderson
Hi Denis...

I had a chance to play with pdfReport on a live survey over the weekend and its working great, thanks again! Based on this I had a couple of other questions that you might be able to help me with or point me in the right direction?

- does the email address input that the report is to be sent to have to be part of the survey? For example, we would like to have an 'Email me this report' input and button on the final page (as part of the 'End Message') after the survey has been submitted, is there any way to accommodate this functionality (i.e. use the button in the report to trigger pdfReport with the supplied email address)?

- the 'Print your answers' link appears at the very end of the report (after the 'End Message' text). Is it possible to move this link to precede the report or to again replicate its functionality from a custom 'Download your PDF' button within the report? I notice the link on the 'Print your answers' link is:

<a href="/survey/index.php?r=printanswers/view&surveyid=XXXXXX" title="Print" your="" answers.="" class=" ls-print "> Print your answers. </a>

could this be used to replicate the 'Print your answers' functionality in a custom button placed in the 'End Message'?

Finally, the PDF generated by the report didn't handle background images very well (didn't show at all), reading the documentation on the pdfReport GitHub page it mentions adding images via:
<img src="/upload/files/picture.png" />
or with Data URI...do you know if there is some way to use background images? (I overlay the images to build up a visual representation of the relevant survey results and am not sure if there is a way to replicate this using <img> tags).

Hopefully these make sense but let me know if any further info required. Many thanks...Rick.
The following user(s) said Thank You: Indispirit

Please Log in or Create an account to join the conversation.

More
3 weeks 19 hours ago #191302 by DenisChenu
Hi

- does the email address input that the report is to be sent to have to be part of the survey? currently yes
- - the 'Print your answers' link appears at the very end of the report (after the 'End Message' text). Is it possible to move this link to precede the report or to again replicate its functionality from a custom 'Download your PDF' button within the report? No … currently the pdf is done ONLY after survey is submitted , maybe you can add at gitlab.com/SondagesPro/ExportAndStats/pd...r/pdfReport.php#L285 : $this->doPdfReports();

For backcgrouund image : did you add gitlab.com/SondagesPro/coreAndTools/limeMpdf ? Maybe you can try : stackoverflow.com/a/47382927/2239406 (else : hacking pdf report to allow Watermark)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: Indispirit, rickanderson

Please Log in or Create an account to join the conversation.

More
3 weeks 16 hours ago #191314 by rickanderson
Dennis...cheers for the quick response and all your help on this.

Will have a look at your suggestion for the 'Print your answers' button and also add limeMpdf to see if that helps with image layering (I also tried absolutely positioned images but that didn't work for the PDF - they were just displayed sequentially).

Best...Rick.

Please Log in or Create an account to join the conversation.

More
3 weeks 9 hours ago #191327 by rickanderson
Hi Denis...

I had a look at your suggested code addition but wondered, since the report (generated via the 'End Message' text) is displayed after the survey is submitted:

currently the pdf is done ONLY after survey is submitted


...could the report include a button that called 'doPdfReports()' or have the link I suggested previously (copied from the 'Print your answers.' link)?

Apologies if i am misunderstanding your suggestion above.

Cheers

...Rick.

Please Log in or Create an account to join the conversation.

More
3 weeks 8 hours ago #191330 by rickanderson
Also...

How does limeMpdf integrate with pdfReport? Does it just have to be added to the plugins and activated to allow pdfReport to utilise Mpdf styling features? Or is limeMpdf used separately from pdfReport and do I then need to add something along the lines of the basic usage example code:

$html = "&lt;p&gt;Some HTML to put in your PDF.&lt;/p&gt;";
$limeMpdfHelper = new \limeMpdf\helper\limeMpdfHelper();
/* Send pdf file to browser for download */
$limeMpdfHelper->doPdfContent($html);

...if so, where would I place this code (in the 'Question' area of the File Upload question being used for the pdfReport)?

Again, apologies I am am misunderstanding your response.

Cheers...Rick.

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #191335 by DenisChenu
If limeMpdf is installed : you have 2 news options in question settings (default to true)


After the difference is more with available CSS and style system.

With limeMpdf : you can use some bootstrap class (see the sample in plugin settings)

This browser does not support PDFs. Please download the PDF to view it: Download PDF


Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Attachments:
The following user(s) said Thank You: Indispirit, rickanderson

Please Log in or Create an account to join the conversation.

More
2 weeks 6 days ago #191349 by rickanderson
Thanks Denis...I hadn't noticed the additional options in the question settings.

Did you also see the other follow-up question I posted above regarding the 'Print your answers.' funtionality (I added the line of code you suggested to pdfReport.php but didn't notice any difference)?
Copied below:

Hi Denis...

I had a look at your suggested code addition but wondered, since the report (generated via the 'End Message' text) is displayed after the survey is submitted:

currently the pdf is done ONLY after survey is submitted



...could the report include a button that called 'doPdfReports()' or have the link I suggested previously (copied from the 'Print your answers.' link)?

Apologies if i am misunderstanding your suggestion above.

Cheers

...Rick.

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #191366 by DenisChenu

rickanderson wrote: …

currently the pdf is done ONLY after survey is submitted



...could the report include a button that called 'doPdfReports()' or have the link I suggested previously (copied from the 'Print your answers.' link)?

I don't know : this need to be developed … and take time …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: rickanderson

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #191370 by rickanderson
Denis...once again thanks for taking the time to answer my questions.

Just in case this helps you or anyone else.

I tried hard-coding the link into the report (via the survey 'End Message'):

<a href="/survey/index.php?r=printanswers/view&surveyid=XXXXXX" title="Print" your="" answers.="" class=" ls-print "> Download your PDF. </a>

...and it seems to work - obviously this would be survey specific because of the use of 'surveyid' but pretty sure there will be some way round that.

I added the limeMpdf plugin and it definitely helps with formatting (thank you) but I still haven't been able to get my images to overlay - since it displays fine on screen I am thinking a possible way round this might be to use html2pdf to dynamically generate the required overlaid image from the screen display and use this via mpdf (per its documentation):

Dynamically generated Images

You can define a script which generates an image just as you can in HTML:

<img src="/files/my_file_generating_script.php?color=red" />



Hopefully final question for you Denis is how can I force a landscape orientation for my PDF using pdfReport or limeMpdf?

Cheers...Rick.

Please Log in or Create an account to join the conversation.

More
2 weeks 5 days ago #191373 by DenisChenu

I tried hard-coding the link into the report (via the survey 'End Message'):

Yes : but not after user close his survey : current response id is get by $_SESSION

There are more clear usage : see the global settings for a sample
<a href="/survey/index.php?r=plugins/direct&plugin=pdfReport&surveyid={SID}&qid={pdf.qid}" title="Print answers" class=" ls-print "> Download your PDF. </a>


else since you use mpdf : you can
- create (via FTP) subviews/mpdf inside your theme directory
- Play with twg file : gitlab.com/SondagesPro/coreAndTools/lime.../views/subviews/mpdf (body.twig i think) to add a pictuire at backround


About landscape : need to hack pdfReport plugin (you can ask a new feature, i can check in february)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Attachments:
The following user(s) said Thank You: rickanderson

Please Log in or Create an account to join the conversation.

More
2 weeks 4 days ago #191403 by Indispirit
Thanks for all the info Denis! We'd be very happy to try and hack landscape into pdfReport and share the results.

Could you tell us which file sets the page width for the PDF?

Please Log in or Create an account to join the conversation.

More
2 weeks 4 days ago #191422 by rickanderson
Hi Denis...

As an alternative (if there is currently no easy way to print landscape using pdfReport/limeMpdf) would it be possible to use the email functionality of pdfReport to send a PDF generated via html2pdf?

Cheers

...Rick.

Please Log in or Create an account to join the conversation.

More
2 weeks 3 days ago - 2 weeks 3 days ago #191434 by DenisChenu
?????

Really more easy to hack limeMpdf or pdfReport for landscape (*) (one line fix) …
than moving to another pdf producer

And since html2pdf is based on tcpdf … you have same issue …


* i can do it in december with a quote : extensions.sondages.pro/about/contact.html

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: 2 weeks 3 days ago by DenisChenu.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!