Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : Customising PDF output

Customising PDF output il y a 2 ans 1 mois #82905

  • ian
  • Portrait de ian
  • Hors ligne
  • Fresh Lemon
  • Messages : 3
  • Karma: 0
Hello,

I'm looking for a way to customize pdf report from survey generated by Lime.

in
/admin/statistics_function.php

are
* pdf Config
*/
if($outputType=='pdf')
{
require_once('classes/tcpdf/config/lang/eng.php');
global $l;
$l = $statlang->gT("Page",'unescaped');
require_once('classes/tcpdf/mypdf.php');

// create new PDF document
$pdf = new MyPDF();
$pdf->SetFont($pdfdefaultfont,'',$pdffontsize);

$surveyInfo = getSurveyInfo($surveyid,$language);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('LimeSurvey');
$pdf->SetTitle('Statistic survey '.$surveyid);
$pdf->SetSubject($surveyInfo);
$pdf->SetKeywords('LimeSurvey, statistics, Survey '.$surveyid.'');
$pdf->SetDisplayMode('fullpage', 'two');

// set header and footer fonts
$pdf->setHeaderFont(Array($pdfdefaultfont, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array($pdfdefaultfont, '', PDF_FONT_SIZE_DATA));

// set default header data
// the path looks awkward - did not find a better solution to set the image path?
$pdf->SetHeaderData("statistics.png", 10, $statlang->gT("Quick statistics",'unescaped') , $statlang->gT("Survey")." ".$surveyid." '".FlattenText($surveyInfo,true,'UTF-8')."'");


// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);
}

I didn't find any other links referring to pdf.

So, is there a template to modify pdf output, or only solution is to modify code above ?

I need to nest some picture in footer, or header if footer isn't available.

Any idea how to do it?
Dernière édition: il y a 2 ans 1 mois par ian.
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Customising PDF output il y a 1 an 7 mois #89734

  • zunch2000
  • Portrait de zunch2000
  • Hors ligne
  • Fresh Lemon
  • Messages : 7
  • Karma: 0
Hi Ian,

I have the same problem.
Did you solve the problem?
Can you help me on that issue?
Can you refer me to someone how can solve my problem?
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Customising PDF output il y a 1 an 7 mois #89752

  • helper
  • Portrait de helper
  • Hors ligne
  • Expert Lime
  • Messages : 126
  • Remerciements reçus 18
  • Karma: 0
Fairly common issue - please vote for my suggestion and/or make a suggestion at: ideas.limesurvey.org/ideatorrent/idea/436/
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Customising PDF output il y a 1 an 7 mois #89756

  • zunch2000
  • Portrait de zunch2000
  • Hors ligne
  • Fresh Lemon
  • Messages : 7
  • Karma: 0
hi
i just voted for you!
in the meanwhile, if you have any idea please i need guidance here.
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Customising PDF output il y a 1 an 7 mois #89757

  • helper
  • Portrait de helper
  • Hors ligne
  • Expert Lime
  • Messages : 126
  • Remerciements reçus 18
  • Karma: 0
Let me start by saying that I am using LimeSurvey Version 2.00+ Build 121204 - and my workarounds are what many would call hacks (not to mention my primary language is Java)...

Now that we have that out of the way the place that you may want to start is ...applications/controllers/PrintanswersController.php

This is where both the printed version and the pdf start.
L'administrateur a désactivé l'accès en écriture pour le public.

Re: Customising PDF output il y a 2 mois 1 semaine #108966

  • jboogie21
  • Portrait de jboogie21
  • Hors ligne
  • Fresh Lemon
  • Messages : 9
  • Karma: 0
I'm reviving this old thread to see if anyone has managed anything in relation to formatting "Print answers" and "Printing to PDF".

This clearly has been an issue for a while, just wondering before I (or someone from my IT dept) starts hacking things to pieces.

jason
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.156 secondes
Donation Image