Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Send response pdf in email

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago - 4 years 5 months ago #191114 by DenisChenu
Replied by DenisChenu on topic Send response pdf in email
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 .
I don't answer to private message.
Last edit: 4 years 5 months ago by DenisChenu.
The following user(s) said Thank You: rickanderson
The topic has been locked.
More
4 years 5 months ago #191118 by rickanderson
Replied by rickanderson on topic Send response pdf in email
Thanks Denis...much appreciated!
The topic has been locked.
More
4 years 5 months ago #191274 by rickanderson
Replied by rickanderson on topic Send response pdf in email
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:

Code:
<a href="/survey/index.php?r=printanswers/view&amp;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:
Code:
<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
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #191302 by DenisChenu
Replied by DenisChenu on topic Send response pdf in email
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 .
I don't answer to private message.
The following user(s) said Thank You: Indispirit, rickanderson
The topic has been locked.
More
4 years 5 months ago #191314 by rickanderson
Replied by rickanderson on topic Send response pdf in email
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.
The topic has been locked.
More
4 years 5 months ago #191327 by rickanderson
Replied by rickanderson on topic Send response pdf in email
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.
The topic has been locked.
More
4 years 5 months ago #191330 by rickanderson
Replied by rickanderson on topic Send response pdf in email
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:

Code:
$html = "&amp;lt;p&amp;gt;Some HTML to put in your PDF.&amp;lt;/p&amp;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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191335 by DenisChenu
Replied by DenisChenu on topic Send response pdf in email
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 .
I don't answer to private message.
The following user(s) said Thank You: Indispirit, rickanderson
The topic has been locked.
More
4 years 4 months ago #191349 by rickanderson
Replied by rickanderson on topic Send response pdf in email
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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191366 by DenisChenu
Replied by DenisChenu on topic Send response pdf in email

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 .
I don't answer to private message.
The following user(s) said Thank You: rickanderson
The topic has been locked.
More
4 years 4 months ago #191370 by rickanderson
Replied by rickanderson on topic Send response pdf in email
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'):

Code:
<a href="/survey/index.php?r=printanswers/view&amp;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.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191373 by DenisChenu
Replied by DenisChenu on topic Send response pdf in email

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
Code:
<a href="/survey/index.php?r=plugins/direct&amp;plugin=pdfReport&amp;surveyid={SID}&amp;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 .
I don't answer to private message.
The following user(s) said Thank You: rickanderson
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose