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

TOPIC: Customising PDF output

Customising PDF output 5 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 2 months 2 days ago #122390

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

Customising PDF output 2 months 2 days ago #122422

  • coeneisma
  • coeneisma's Avatar
  • Offline
  • Senior Lime
  • Posts: 40
  • Thank you received: 4
  • Karma: 2
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 2 months 2 days ago #122424

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5725
  • Thank you received: 334
  • 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 months 1 day ago #122469

  • coeneisma
  • coeneisma's Avatar
  • Offline
  • Senior Lime
  • Posts: 40
  • Thank you received: 4
  • Karma: 2
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 months 1 day ago #122472

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5725
  • Thank you received: 334
  • 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 months 22 hours ago #122482

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 7510
  • Thank you received: 1024
  • Karma: 297
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 2 months 19 hours ago #122492

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5725
  • Thank you received: 334
  • 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 2 months 17 hours ago #122494

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 7510
  • Thank you received: 1024
  • Karma: 297
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.279 seconds