Welcome to the LimeSurvey Community Forum

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

PDFreport creates no PDFs, only fu_######## files.... what am I doing wrong?

  • Sweden
  • Sweden's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 2 weeks ago - 5 years 2 weeks ago #191791 by Sweden
Hi there,

I have installed the plugin "PDFreport" in LimeSurvey version 3.20.2+191119. It looks like a great plugin, but I must have done something wrong because no PDF files are being created at the end of the survey. All that is created is a file named e.g. fu_321476458644 (looks like random numbers) in the files folder "upload/surveys/455657/files".

I have followed the instructions - activated the plugin, created an upload file question and modified the PDF options (and plugin settings in plugin manager). Do I need to activate any special PHP extensions to make it work (a checkmark in the "PDF" extension did nothing).

I don't want to send the PDF via email - I just want a download link at the end that the user can click. I have inserted the link, but nothing happens when I click it (however, I can see that an fu_########## is created in the mentioned folder).

Any clues to what is going on and what I need to change?

Thanks for any help.
Last edit: 5 years 2 weeks ago by Sweden.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 weeks ago #191800 by Joffm
Which settings do you have in pdfreport?
With


and of course "participants may print answers"

it works as expected here.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Sweden
The topic has been locked.
  • Sweden
  • Sweden's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 2 weeks ago - 5 years 2 weeks ago #191807 by Sweden
Thanks very much for your help!

Changing "Add attachments of email" from "Off" to "On" seems to have done it. I thought that switch only had something to do with the email sending part, which I don't need. Also had to change "Allow public download (with the link)" to "Replace public print answer", which I had already tried, AND yes of course also the "allow participants to print answers" (that I for some reason had set to "Off"). Got my first PDF downloaded - great plugin!

I have a few questions now - maybe you or somebody else know the answers?

1) I tried to insert a download link to the PDF file at the end of the survey (using the link shown in the PDFreport plugin settings, with the right QID). However, all I see is the browsers spinning wheel. Nothing else happens. Same result if I use it as the URL that can be automatically loaded at the end when the survey is completed. Not sure what is wrong, but is it possible to somehow force the PDF download?

2) Can I prevent the files that are being created from being stored on the server after the participant has downloaded the PDF? (I can see that fu_######## files are created, not sure what they are, there are no PDFs). I don't want any result files on the server because they may contain personal information.

3) TCPDF have had some severe security bugs in the past that allowed access to files on servers etc. I'm sure those vulnerabilities have been fixed by now, but I also see that a new version of this library is under development and that the old version will not receive any additional development. Is it safe to use this plugin with the current TCPDF version? Just want to prevent an evil person from using the survey/plugin to gain access to files on the server, spread spam, infect participants computers with virus etc.

4) Is it possible to completely disable/remove the whole email sending part? I don't need it and it would be one less thing to worry about. What specific files and code parts do I need to remove?

Thanks again for your help - I'm so glad that I can see a PDF file now!
Last edit: 5 years 2 weeks ago by Sweden.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 weeks ago #191819 by Joffm
Hi, Sweden,
when I run the demo survey I get this at the end


and clicking the link the windows dialogue appears with the report file




I think this is what you are trying to achieve.
So the best is to copy this demo and insert your questions. Adapt the text on the end message.

2. These fu... files are pure PDFs. Download one and open with a pdf reader.
As you might know, the server uploads a file with a random name (fu...., fu=file upload). Afterwards this file may be renamed by the program.
LimeSurvey stores this in the upload question like this (so there is the link to the original file (fu...)
[{ "size":"124.446","name":"ThisIsTheRealFileName.docx","filename":"fu_5peh9cxkt5b6326","ext":"docx" }]

3. TCPDF related

4. What do you mean? Set it to "NO" resp. leave fields empty.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu, Sweden
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 years 2 weeks ago #191825 by DenisChenu
Hi,
Thank you @Joffm :)

1. For the dowload link : please update to last pdfReport version gitlab.com/SondagesPro/ExportAndStats/pdfReport . With old version : print your answer is the best solution.
2. No : it's the way it's done in this plugin. Maybe you can try gitlab.com/SondagesPro/ExportAndStats/sendPdfReport ( No free support with this plugin)
3. Plugin use tcpdf included in LimeSurvey , if there are security issue : report to limesurvey mantis.
4. See @Joffm answer

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: Sweden
The topic has been locked.
  • Sweden
  • Sweden's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 2 weeks ago - 5 years 2 weeks ago #191838 by Sweden
Hi Joffm and DenisChenu,

Thanks to both of you. Great plugin DenisChenu!

I will take a closer look on the demo and see why the download link works there and not here. I can only download the PDF if I click the "Print your answers". It would be perfect if there was a way to force the download at the end of the survey.

Since I don't need the email sending part I just thought that perhaps it would be possible to delete the files and part of the code that deals with that from the server (for security reasons - people can't hack into something that doesn't exist). Perhaps that code is part of LimeSurvey and not the plugin files?

Why didn't I guess that the files that start with fu=file upload files... :o) Thanks.
Perhaps a cron job that deletes all fu_##### files older than 1 day would solve one of my problems. I have to figure out how to do it (unless someone here knows it?)

Have a great weekend and thanks again for your help!
Last edit: 5 years 2 weeks ago by Sweden.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
5 years 2 weeks ago #191839 by DenisChenu
About saving elsewhere : gitlab.com/SondagesPro/ExportAndStats/pd...pdfReport.php#L82-88

But since i didn't need it currently : contribution is welcome. Can make an offer start of next year :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The following user(s) said Thank You: Sweden
The topic has been locked.
  • Sweden
  • Sweden's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 2 weeks ago #191850 by Sweden
Thanks DenisChenu. I haven’t had much time to play with your great plugin, but that is very good to know :) I might just need that.
The topic has been locked.
Moderators: holchtpartner

Lime-years ahead

Online-surveys for every purse and purpose