- Posts: 59
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
PDFreport/limeMpdf - how to change the PDF permissions and metadata?
- Sweden
- Topic Author
- Offline
- Senior Member
Less
More
4 years 3 weeks ago #196000
by Sweden
PDFreport/limeMpdf - how to change the PDF permissions and metadata? was created by Sweden
Hi there,
I got PDFreport and limeMpdf installed and I want students to be able to print the PDF that is created, but not allow to copy/modify/fill-out content.
I think this code
should do it, but in what file/folder and where in the code would it be best to insert this so updates don't delete it?
Same question for SetAuthor('school name') - probably the same place, but I better ask so it also works in the future
I got PDFreport and limeMpdf installed and I want students to be able to print the PDF that is created, but not allow to copy/modify/fill-out content.
I think this code
Code:
$mpdf->SetProtection(array('print'), '', 'MyPassword');
Same question for SetAuthor('school name') - probably the same place, but I better ask so it also works in the future
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
4 years 3 weeks ago #196006
by DenisChenu
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.
Replied by DenisChenu on topic PDFreport/limeMpdf - how to change the PDF permissions and metadata?
Make a fork of pdfReport
And try here :
gitlab.com/SondagesPro/ExportAndStats/pd...r/pdfReport.php#L560
$pdfHelper->SetProtection(array('print','modify'), '', 'MyPassword');
And try here :
gitlab.com/SondagesPro/ExportAndStats/pd...r/pdfReport.php#L560
$pdfHelper->SetProtection(array('print','modify'), '', 'MyPassword');
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: Sweden
The topic has been locked.
- Sweden
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 59
- Thank you received: 3
4 years 3 weeks ago #196030
by Sweden
Replied by Sweden on topic PDFreport/limeMpdf - how to change the PDF permissions and metadata?
Thanks, but I'm not sure I understand - I'm not good at php...
I tried to insert:
$pdfHelper->SetProtection(array('print','modify'), '', 'MyPassword');
at line 561 in plugins/pdfReport/pdfReport.php, but I get this error:
500: Internal Server Error. Call to undefined method limeMpdf\helper\limeMpdfHelper::SetProtection()
I tried to insert:
$pdfHelper->SetProtection(array('print','modify'), '', 'MyPassword');
at line 561 in plugins/pdfReport/pdfReport.php, but I get this error:
500: Internal Server Error. Call to undefined method limeMpdf\helper\limeMpdfHelper::SetProtection()
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
4 years 3 weeks ago #196086
by DenisChenu
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.
Replied by DenisChenu on topic PDFreport/limeMpdf - how to change the PDF permissions and metadata?
Arg , you're right ...
pdfHelper didn't exend mpdf ...
Check somewhere here :
gitlab.com/SondagesPro/coreAndTools/lime...fHelper.php#L173-184
pdfHelper didn't exend mpdf ...
Check somewhere here :
gitlab.com/SondagesPro/coreAndTools/lime...fHelper.php#L173-184
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: Sweden
The topic has been locked.
- Sweden
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 59
- Thank you received: 3
4 years 3 weeks ago #196102
by Sweden
Replied by Sweden on topic PDFreport/limeMpdf - how to change the PDF permissions and metadata?
Thanks again Denis. Sadly, I don't know how to extend mpdf and googling didn't provide a solution
I really need to learn php... does it take a lot of coding to extend mpdf?
I really need to learn php... does it take a lot of coding to extend mpdf?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
4 years 3 weeks ago #196105
by DenisChenu
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.
Replied by DenisChenu on topic PDFreport/limeMpdf - how to change the PDF permissions and metadata?
I didn't say to extend mpdf ...
I say add
somewhere here :
gitlab.com/SondagesPro/coreAndTools/lime...fHelper.php#L173-184
It's a quick fix and your broke upgrade of mpdf, but maybe it work.
I say add
Code:
$mpdf->SetProtection(array('print','modify'), '', 'MyPassword');
somewhere here :
gitlab.com/SondagesPro/coreAndTools/lime...fHelper.php#L173-184
It's a quick fix and your broke upgrade of mpdf, but maybe it work.
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: Sweden
The topic has been locked.