Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Customising PDF output

Customising PDF output 3 months 2 weeks ago #118330

  • kayesm
  • kayesm's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Sweden, did you end up resolving how to do this? I too would like to output the results into a mPDF for the participants to keep a copy.

Anyone know how to do this easily?

Thanks!!
The administrator has disabled public write access.

Customising PDF output 4 days 1 hour ago #122390

  • coeneisma
  • coeneisma's Avatar
  • Offline
  • Junior Lime
  • Posts: 32
  • Thank you received: 2
  • Karma: 1
Also really interested in the sollution! Anybody?
The administrator has disabled public write access.

Customising PDF output 3 days 16 hours ago #122422

  • coeneisma
  • coeneisma's Avatar
  • Offline
  • Junior Lime
  • Posts: 32
  • Thank you received: 2
  • Karma: 1
As I need a custom pdf-export on short notice I just hired a programming friend. When finished i'll ask him to give a short how-to.
The administrator has disabled public write access.

Customising PDF output 3 days 15 hours ago #122424

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5694
  • Thank you received: 329
  • Karma: 255
coeneisma wrote:
As I need a custom pdf-export on short notice I just hired a programming friend. When finished i'll ask him to give a short how-to.
We are looking forward to your feedback.

On a side note: What speaks against simply adding a "Print to PDF" button to the printanswers screen (which you can style nicely using the template.css file) which calls the browsers print option?
Most modern browsers support direct PDF printing (others can install a PDF driver)?

I did this for several projects in the past and this is an easy to implement solution.

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Customising PDF output 2 days 16 hours ago #122469

  • coeneisma
  • coeneisma's Avatar
  • Offline
  • Junior Lime
  • Posts: 32
  • Thank you received: 2
  • Karma: 1
Nothing against it, but my PDF-export is not an export of the printanswers screen, but a custom EM-generated feedback page with custom generated graphs.
The administrator has disabled public write access.

Customising PDF output 2 days 14 hours ago #122472

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5694
  • Thank you received: 329
  • Karma: 255
Anyway, why do you try to wrap this into a PDF by using an external tool if most browsers can print to PDF?

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Customising PDF output 2 days 1 hour ago #122482

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 7363
  • Thank you received: 1009
  • Karma: 291
Hi
Yii::import('application.libraries.admin.pdf', true);
    Yii::import('application.helpers.pdfHelper');
 
    $aPdfLanguageSettings=pdfHelper::getPdfLanguageSettings(Yii::app()->lang->langcode);
    $aSurvey=getSurveyInfo($this->iSurveyId,Yii::app()->lang->langcode);
    define('K_PATH_IMAGES', getTemplatePath($aSurvey['template']).DIRECTORY_SEPARATOR);
 
    $sSurveyName = $aSurvey['surveyls_title'];
    $sHeader=Yii::app()->getConfig('sitename');
    $sSubHeader = $sSurveyName;
 
    $oPDF = new pdf();
    $sText = functionCallToProduceContent();
    $sCssContent=functionCallToProduceCss();
    $sText="<style>\n{$sCssContent}\n</style>\n$sText\n";
    $oPDF->initAnswerPDF($aSurvey, $aPdfLanguageSettings, $sHeader, $sSubHeader);
    // output the HTML content
    $oPDF->writeHTML($sText, true, false, true, false, '');
    $oPDF->lastPage();
 
    header("Pragma: public");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    $sExportFileName = sanitize_filename($sSurveyName);
    $oPDF->Output($sExportFileName."-".$this->iSurveyId.".pdf","D");
The administrator has disabled public write access.

Customising PDF output 1 day 22 hours ago #122492

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5694
  • Thank you received: 329
  • Karma: 255
Denis, can you provide some more documentation and details related to this code?!

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Customising PDF output 1 day 20 hours ago #122494

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 7363
  • Thank you received: 1009
  • Karma: 291
This code produce a PDF file with:
HTML content from functionCallToProduceContent (for example : a question text, the "full response table etc ..)
With CSS style from functionCallToProduceCss

Need $this->iSurveyId

Is part of code i use for "own PDF export", replacing the default link with my own link (but in JS .... sh*t ..)
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.274 seconds