- Posts: 1
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
PDF-Export of Answer-page via javascript
- Kalle2015
- Topic Author
- Offline
- New Member
Less
More
9 years 1 month ago #117619
by Kalle2015
PDF-Export of Answer-page via javascript was created by Kalle2015
Hello everyone,
I was trying to set up a "PDF Print" Button, to enable participants to print out the shown answers. I used jsPDF, which finally worked quite well. jsPDF takes the HTML and some CSS style-information and creates a simple PDF file. Problem is the style-options are rather basic, color-information are lost for example.
Does anyone have any experiences in setting up a jsPDF PDF-Export in lime?
Any other suggestions, how this could be realised?
Thanks a lot!
I was trying to set up a "PDF Print" Button, to enable participants to print out the shown answers. I used jsPDF, which finally worked quite well. jsPDF takes the HTML and some CSS style-information and creates a simple PDF file. Problem is the style-options are rather basic, color-information are lost for example.
Does anyone have any experiences in setting up a jsPDF PDF-Export in lime?
Any other suggestions, how this could be realised?
Thanks a lot!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
9 years 1 month ago #117625
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 PDF-Export of Answer-page via javascript
Hi,
I use "print page" for this. Think it's better.
It's not linked with LimeSUrvey, but seems jsPDF has own system for color/style. In the example:
doc.setTextColor(100);
doc.text(20, 20, 'This is gray.');
Maybe you can try with :
I use "print page" for this. Think it's better.
It's not linked with LimeSUrvey, but seems jsPDF has own system for color/style. In the example:
doc.setTextColor(100);
doc.text(20, 20, 'This is gray.');
Maybe you can try with :
Code:
var doc = new jsPDF(); // We'll make our own renderer to skip this editor var specialElementHandlers = { '#editor': function(element, renderer){ return true; } }; // All units are in the set measurement for the document // This can be changed to "pt" (points), "mm" (Default), "cm", "in" doc.fromHTML($('#render_me').get(0), 15, 15, { 'width': 170, 'elementHandlers': specialElementHandlers });
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 topic has been locked.
- Robert1973
- Offline
- Junior Member
Less
More
- Posts: 21
- Thank you received: 0
6 years 1 month ago #164599
by Robert1973
Replied by Robert1973 on topic PDF-Export of Answer-page via javascript
Hi Kalle2015, I'm interested how you got this to work. Would you like to share your code and the steps you took?
Many thanks in advance,
Robert
Many thanks in advance,
Robert
The topic has been locked.